[R] Multiple lattice plots on a page: aligning x-axes vertically

2009-01-25 Thread Daniel Myall
nt(plot.density, position = c(0.0988,0.22,0.98,1), newpage = FALSE) } example.data <- data.frame(subject_ID = c('A01','B01','A02','B02'), subject_group = c('pop1','pop2'), task= c(rep('task1',32),rep('task2'

[R] Writing a helper function that takes in the dataframe and variable names and then does a subset and plot

2007-11-15 Thread Daniel Myall
Hi, I have a large dataframe than I'm writing functions to explore, and to reduce cut and paste I'm trying to write a function that does a subset and then a plot. Firstly, I can write a wrapper around a plot: plotwithfits <- function(formula, data, xylabels=c('','')) { xyplot(formula, data