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

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -