[R] Newbie question: Converting Table

Metronome123 lars.hulzebos at gmail.com
Fri Sep 23 12:59:29 CEST 2011


I'm new to R, and I have searched helpfiles and this forum on my 2
questions. Hope you guys can help me out! :-)

Many thanks in advance!



Q1: I imported a csv file with columnames subject and class. There are about
1000 different classes... 
It looks like this:
subject1, class1
subject1, class2
subject2, class1
subject2, class3
subject999, class1
subject999, class2

Now I want to transform this in R into a table (with columnnames
subject,class1,class2,...) like:
subject1, yes, yes, no, ...
subject2, yes, no, yes, ...

Q2: I want to count the matching class patterns in the previous table
(output: in a table with columns count, class1, ...). In this example for
only the subjects1,2 and 999 it looks like this:

View this message in context: http://r.789695.n4.nabble.com/Newbie-question-Converting-Table-tp3836468p3836468.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list