Currently the R Snippet node only supports lists, arrays, vectors, and single elements of type double, int, and string - in one of our future releases, we will also support matrices. It's pretty high on my todo.
Anyway, to overcome this problem, you can use two R Snippet nodes, one outputs the attribute values and the other the frequencies, that is, R<-names(table(val1)) and R<-table(val1) The Joiner node can then aggregate the two R results into one table. Make sure you handle duplicate column names within the Joiner node's dialog. Finally it should look similar to this screenshot:
Note, both R nodes need to be executed one after the other, since the variable R is used within both nodes as result value.