I get the following message when using the reshape2 package line
tDat.m- melt(Dataset)
Using Item, Subject as id variables
tDatCast- acast(tDat.m,Subject~Item)
Aggregation function missing: defaulting to length
Note Problem Statement-
convert dataframe
Subject Item Score
1 Subject 1 Item
Hi Ajay,
I'm not sure what the problem is, and I don't think your description
is enough to reproduce it. This works fine for me
library(reshape2)
dat - read.table(textConnection('Subject Item Score
Subject 1 Item 1 1
Subject 1 Item 2 0
Subject 1 Item 3 1
Subject 2 Item 1 1
Hi:
xtabs() also works in this case:
dat - read.table(textConnection('Subject Item Score
+ Subject 1 Item 1 1
+ Subject 1 Item 2 0
+ Subject 1 Item 3 1
+ Subject 2 Item 1 1
+ Subject 2 Item 2 1
+ Subject 2 Item 3 0'), header=TRUE)
closeAllConnections()
acast(dat,
3 matches
Mail list logo