You can just use table()
:
> a <- table(numbers) > a numbers 4 5 23 34 43 54 56 65 67 324 435 453 456 567 657 2 1 2 2 1 1 2 1 2 1 3 1 1 1 1
Then you can subset it:
> a[names(a)==435] 435 3
Or convert it into a data.frame if you’re more comfortable working with that:
> as.data.frame(table(numbers)) numbers Freq 1 4 2 2 5 1 3 23 2 4 34 2 ...
Related Posts:
- Sample random rows in dataframe
- Replace all 0 values to NA
- R Hex to RGB converter
- Non-numeric Argument to Binary Operator Error in R
- Error in ggplot.data.frame : Mapping should be created with aes or aes_string
- Error in file(file, “rt”) : invalid ‘description’ argument in complete.cases program
- SummarySE (Rmisc package) to produce a barplot with error bars (ggplot2)
- Editing legend (text) labels in ggplot
- Logistic Regression on factor: Error in eval(family$initialize) : y values must be 0 <= y <= 1
- R – longer object length is not a multiple of shorter object length
- Error: attempt to use zero-length variable name
- “non-numeric argument to binary operator” error in R
- Replace all particular values in a data frame
- What does “The following object is masked from ‘package:xxx'” mean?
- How can I convert Json to data frame in R
- Error in xj[i] : invalid subscript type ‘list’
- How do you specifically order ggplot2 x axis instead of alphabetical order?
- Error in
: target of assignment expands to non-language object - Error: Invalid number of ‘breaks’ in R
- Batch convert columns to numeric type
- Deleting rows that are duplicated in one column based on the conditions of another column
- What is the difference between require() and library()?
- What is the meaning of the dollar sign “$” in R function()?
- Use of ~ (tilde) in R programming Language
- How can I change the name of a data frame
- Convert data.frame column to a vector?
- In R, dealing with Error: ggplot2 doesn’t know how to deal with data of class numeric
- Error in file(file, “rt”) : cannot open the connection [duplicate]
- ggplot2 line chart gives “geom_path: Each group consist of only one observation. Do you need to adjust the group aesthetic?”
- check if a std::vector contains a certain object?
- C++ for each, pulling from vector elements
- How do I erase an element from std::vector<> by index?
- How do I reverse a C++ vector?
- Error in colMeans(x, na.rm = TRUE) : ‘x’ must be numeric in KNN classification
- rmarkdown error “attempt to use zero-length variable name”
- Extract year from date
- incorrect number of dimensions and incorrect number of subscripts in array
- Rotating and spacing axis labels in ggplot2
- R: Using equation with natural logarithm in nls
- What does c do in R?
- Reading PSV (pipe-separated) file or string
- Manually colouring plots with `scale_fill_manual` in ggplot2 not working
- Calculate correlation for more than two variables?
- Function to clear the console in R and RStudio
- Invalid factor level, NA generated warning
- Can’t draw Histogram, ‘x’ must be numeric
- Convert date-time string to class Date
- Generate a set of random unique integers from an interval
- Why doesn’t std::vector::push_front() exist?
- How do I get RSS from a linear model output
- Warning message: In `…` : invalid factor level, NA generated
- No operator << matches these operands
- Mean of a column in a data frame, given the column’s name
- Still getting error in dev.off() : cannot shut down device 1 (the null device)
- How to get summary statistics by group
- Run R script from command line
- ‘height’ must be a vector or a matrix. barplot error
- dplyr: “Error in n(): function should not be called directly”
- How do I install an R package from source?
- C++ Erase vector element by value rather than by position?
- Plotting data in R; error: default method not implemented for type ‘list’
- Changing fonts in ggplot2
- run a for loop in parallel in R
- Error in na.fail.default: missing values in object – but no missing values
- How to find out which package version is loaded in R?
- What do these R glm error messages mean: “Error: no valid set of coefficients has been found: please supply starting values”
- Error in G * t(hat) : non-conformable arrays
- How to get the vector between two vectors?
- How to calculate combination and permutation in R?
- “Cannot allocate an object of abstract type” error
- How to cache a shortcode functions output?
- Count singular post views automatically
- User Published Post Count
- Add character count to custom metabox
- How to get the number of child categories a specific parent category has?
- Display posts count in front of the tag, for each tag
- right_now_content_table_end function not working?
- How can I count post views of REST API calls and update them in an ACF field?
- User’s total comment count excluding comments on their own posts
- Get Gravity Forms field values and count how many? [closed]
- Counting posts with argument without retrieving the posts
- How to add category post count in main navigation menu [closed]
- How to count the number of archives there are
- Single.php Category Post Count
- Display count of new members registered today [closed]
- Post loop count is not in order
- How can i count post from my post type taxonomy
- How can i count the post added in relationship field, theme display
- Show the amount of posts in a tag in a specific category has
- Divide post content in three columns
- Author post count in category
- How can I show how much water got saved on this order (making use of the number of items bought) on a thank-you-page?
- Show post count in custom taxonomy page
- Display number of post published every day
- WPDB delivers wrong results from complex queries
- For each 3 posts, show a different post type
- Counting custom post type with wp_count_posts returns an empty object
- How to mark every 3rd post
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- ho can I get the number of the current post instead of the post id?