R: Produce machine-readable output for summary / describe
I have a data frame with 10k rows and 500 columns. For each column, I want
to create a count for each unique value in the row. E.g.
Fruit Vegetable Meat
1 Apple Carrot Steak
2 Apple Potato Chicken
3 Pear Peas Duck
Would produce:
Fruit;Apple;2;Pear;1
Vegetable;Carrot;1;Potato;1;Peas;1
Meat;Steak;1;Chicken;1;Duck;1
The Hmisc describe function produces this kind of analysis, but the output
is so badly formatted as to be useless.
Thanks.
No comments:
Post a Comment