I am using apply for the first time. I want to count the number of occourences of values in my dataset. I have 10 variables/columns.
This works:
apply(data, 2, function(x) {count(x)}
However instead of getting the results prointed in the console window, I want to print the result of the apply function of each column in separate datatables something like this:
apply(data, 2, function(x) data_x<-{count(x)}
It is not working unfortunately.