Re: [R] Aggregating data help

2011-10-20 Thread F Mai
check this out http://www.r-bloggers.com/pivot-tables-in-r/ -- View this message in context: http://r.789695.n4.nabble.com/Aggregating-data-help-tp3923138p3923397.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

Re: [R] Aggregating data help

2011-10-20 Thread Dennis Murphy
Hi: Here's a way using the reshape2 package. library('reshape2') rsub <- subset(rtest, concept %in% c('8.2.D', '8.3.A', '8.3.B')) # want year ahead of concept in the variable list rsub <- rsub[, c(1:4, 9, 5:8)] cast(rsub, id + test + subject + grade + year ~ concept, value_var = 'per_corr') # Us

[R] Aggregating data help

2011-10-20 Thread James Holland
Hello, I have a dataset with student performance on a math test. There are multiple cases for each student (identified by id) and the concept as a variable. > rtest id test subject gradeconcept correct tested per_corr year 11 83 Mathema 8 8.2.D 1