Re: [R] Factors to Columns

2011-05-20 Thread David martin
Works !! thanks On 05/20/2011 12:08 PM, Dennis Murphy wrote: Hi: I'm not sure I have the student part right, but here's one way to get the structure you're looking for with the reshape2 package: Example: dat<- data.frame(student = rep(1:10, 3), val = round(rnorm(30, m = 22.5

Re: [R] Factors to Columns

2011-05-20 Thread Dennis Murphy
Hi: I'm not sure I have the student part right, but here's one way to get the structure you're looking for with the reshape2 package: Example: dat <- data.frame(student = rep(1:10, 3), val = round(rnorm(30, m = 22.5, s = 3.0), 1), parm = factor(rep(c('AGE', 'SC

[R] Factors to Columns

2011-05-20 Thread David martin
> str(data) 'data.frame': 250 obs. of 3 variables: $ student: chr "A" "B" "C" "D" ... $ data : num 20.2 20.4 22.5 22.1 23.3 ... $ param : Factor w/ 4 levels "AGE","SCHOOL",..: 1 1 1 1 1 1 1 1 1 1 Hi , i would like to split the dataframe so that each level of param is a column At th