r - Finding Frequency of each letter in a data frame -
i have data frame looks following:
col1 col2 col3 b c d e b
i need find total number of occurrences of letters a,b,c,d , e.
i have used lapply along table function in following manner:
z =apply(t[,1:3],2,table)
it gives list of frequency of each letter in each column. going wrong?
table(as.matrix(dat))
or rstudent suggested:
table(unlist(dat))
data
dat<- read.table(text="col1;col2;col3 a;b;a c;a;d e;a;b ", header=true, sep=";")
Comments
Post a Comment