View source: R/nonDuplicated.R
nonDuplicated | R Documentation |
Subset a data frame using non duplicated elements in a vector.
nonDuplicated(x, y, change.rownames = FALSE, na.rm = FALSE)
x |
a data frame. |
y |
a vector. It can be a name of a column in |
change.rownames |
if original rownames of |
na.rm |
logical. If rows should be removed where |
This function is handy to keep only one set of duplicated data that is common in long formatted database files.
A data frame.
Peter Solymos <solymos@ualberta.ca>
duplicated
data(abmibirds)
x <- nonDuplicated(abmibirds, abmibirds$ABMI.Site, TRUE)
## or equivalently
#x <- nonDuplicated(abmibirds, ABMI.Site, TRUE)
dim(abmibirds)
dim(x)
length(unique(abmibirds$ABMI.Site))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.