- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

We can do this by using table function with as.data.frame

> X <- c(25, 34, 25, 47, 69, 69, 69, 23, 24, 25, 23, 21, 70, 34, 25, 47, 21, 23, 69, 69, 25, 64) > as.data.frame(table(X)) X Freq 1 21 2 2 23 3 3 24 1 4 25 5 5 34 2 6 47 2 7 64 1 8 69 5 9 70 1

- Related Questions & Answers
- How to create a vector with repeated values in R?
- How to create frequency table of a string vector in R?
- How to find the frequency of repeated and unique values in a vector in R?
- How to create the plot of a vector that contains missing values by adding the missing values in base R?
- How to find unique permutations if a vector contains repeated elements in R?
- How to create a frequency table in R that includes zero frequency for value that are not available?
- How to find the position of one or more values in a vector into another vector that contains same values in R?
- How to create frequency table of data.table in R?
- How to create a vector with zero values in R?
- How to create a random vector for a range of values in R?
- How to create a table of frequency for range of values in an R data frame column?
- How to create a matrix using vector of string values in R?
- How to extract strings that contains a particular substring in an R vector?
- How to create bin frequency table in R?
- How to find the index of the last occurrence of repeated values in a vector in R?

Advertisements