I would like to return the count of the unique values for every column in a table. For example, if I have the table:
Testdata <- data.frame(var_1 = c(\"a
You could use apply:
apply
apply(Testdata, 2, function(x) length(unique(x))) # var_1 var_2 var_3 # 1 1 3