ector(as.matrix(dat[5:7])),
list(rep(dat$id,3),as.vector(as.matrix(dat[2:4]))),I)
df
}
system.time(result <- phil(dat))
-Original Message-
From: Phil Spector [mailto:spec...@stat.berkeley.edu]
Sent: Thursday, February 25, 2010 5:38 PM
To: Doran, Har
Harold -
Here's what I came up with:
tapply(as.vector(as.matrix(dat[5:7])),
+ list(rep(dat$id,3),as.vector(as.matrix(dat[2:4]))),I)
item1 item10 item2 item3 item4 item5 item7 item9
1NA NA 1NANA 1NA 0
2 0 NANANANA 1 1N
Suppose I have a data frame like "dat" below. For some context, this is the
format that represents student's taking a computer adaptive test. first.item is
the first item that student was administered and then score.1 is the student's
response to that item and so forth.
item.pool <- paste("item
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of Doran, Harold
> Sent: Thursday, February 25, 2010 10:35 AM
> To: r-help@r-project.org
> Subject: [R] Restructure some data
>
> Suppose I have a data fra
4 matches
Mail list logo