Displaying 1 result from an estimated 1 matches for "bysubject".
2009 Jan 25
1
Multiple lattice plots on a page: aligning x-axes vertically
...attice)
plotdensitymeans <-
function(data,measure,factors=c('subject_group','task'),
xlab="",xlim=NULL, ...) {
# Create means by subject
x.melted <- melt(data, id.var = append(factors,'subject_ID'),
measure.var=measure,na.rm=T)
formula.bysubject.cast <- paste(factors[1],"+",factors[2],"+
subject_ID ~ .")
x.cast.subject <- data.frame(cast(x.melted,formula.bysubject.cast,
mean))
# Plot means by subject
text.formula <- paste(factors[1],":",factors[2],"~ X.all.")
text.group...