[R] Aggregate over multiple and unequal column length data frames

Ek Esawi esawiek at gmail.com
Wed Feb 28 15:36:40 CET 2018


Thank you again Pikal and Bert. Using lapply, as Bert suggested, was
the first thing that i thought of dealing with this question and  was
mentioned in my original posting. I just did not know how to implement
it to get the results/form i want. Below is what i did but could not
get it to give me the results as i want which was given on Pikal's
answer.

nlist <- list(df1$col2,df2$col2, df3$col2)

lapply(nlist, function(x) table(x))
[[1]]
x
aa bb cc dd
 2  1  1  1

[[2]]
x
bb cc
 3  1

[[3]]
x
aa
 2



More information about the R-help mailing list