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

node.js - How to mock a third-party api calls in the backend -

node.js - Why do I get "SOCKS connection failed. Connection not allowed by ruleset" for some .onion sites? -

matlab - 0-by-1 sym - What do I need to change in order to get proper symbolic results? -