Displaying 1 result from an estimated 1 matches for "breask".
Did you mean:
break
2005 May 20
5
getting the unique values and counts from a vector
Hi all,
>From a vector, I want to get the unique values and the counts of these
unique values in the vector. For example,
x<-c(2 ,1 ,2, 1, 4 ,2 ,1, 4 ,1 ,1)
xu<-unique(x)
xn<-numeric(length(xu))
for (i in 1:length(xu)) {xn[i]<-length(which(x==xu[i]))}
There must be a very much simpler method of doing this. Can somebody
direct me to the functions that I must read in order to do