Had to look this one up, so here it is:
length(unique(x))
Counts the number of distinct items in a vector in R.
Had to look this one up, so here it is:
length(unique(x))
Counts the number of distinct items in a vector in R.
This entry was posted on Thursday, March 18th, 2010 at 1:21 pm and is filed under feature, r. You can follow any comments to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.
© 2024.
Thanks Matt this was helpful.