Do you mean unique
:
R> x = c(1,1,2,3,4,4,4)
R> x
[1] 1 1 2 3 4 4 4
R> unique(x)
[1] 1 2 3 4
More Related Contents:
- R memory management / cannot allocate vector of size n Mb
- Counting unique / distinct values by group in a data frame
- Test if a vector contains a given element
- Counting the number of elements with the values of x in a vector
- How to find common elements from multiple vectors?
- Finding All Positions for Multiple Elements in a Vector
- Convert a dataframe to a vector (by rows)
- How to join (merge) data frames (inner, outer, left, right)
- Why are these numbers not equal?
- Count number of rows within each group
- Drop unused factor levels in a subsetted data frame
- Use dynamic name for new column/variable in `dplyr`
- Select rows from a data frame based on values in a vector
- Issue when passing variable with dollar sign notation ($) to aes() in combination with facet_grid() or facet_wrap()
- How can I remove all duplicates so that NONE are left in a data frame?
- strptime, as.POSIXct and as.Date return unexpected NA
- Controlling number of decimal digits in print output in R
- Why is it not advisable to use attach() in R, and what should I use instead?
- Round up from .5
- Create an empty data.frame
- What does “The following object is masked from ‘package:xxx'” mean?
- How do you specifically order ggplot2 x axis instead of alphabetical order? [duplicate]
- Export data from R to Excel
- How to sort a character vector where elements contain letters and numbers?
- How should I deal with “‘someFunction’ is not an exported object from ‘namespace:somePackage'” error? [closed]
- How to access the last value in a vector?
- Extract every nth element of a vector
- Error in if/while (condition) { : argument is of length zero
- What does “S3 methods” mean in R?
- How to get help in R?