[R] How to count the number of different elements in a column

chuck.01 CharlieTheBrown77 at gmail.com
Mon Nov 26 14:29:27 CET 2012


length(unique(a))



Hard Core wrote
> Hello,
> Suppose that i have a dataframe
> a <- read.dta("banca_impresa.dta")
> 
> i have a column with 17900 obs like 
> 
> 1
> 2
> 3
> 1
> 6
> 7
> 8
> 3
> 4
> 4
> 
> and i want to know the number of the different values so in this case it
> would be 7 
> How can i do? 
> Thank you





--
View this message in context: http://r.789695.n4.nabble.com/How-to-count-the-number-of-different-elements-in-a-column-tp4650825p4650833.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list