here is a simple problem that you have probably already encountered, but it brings me a big headache ...
I have a dataframe like this:
set.seed(3) mydata <- data.frame(var = rnorm(100,20,1), temp = sin(sort(rep(c(1:10),10))), subj = as.factor(rep(c(1:10),5)))
and I need to make a scatter plot for each subj, not a problem, but ... I want to replace the bars from the grid and add a label to each plot. I manage to do this with the following code, but I'm still not happy ...
xyplot(var ~ temp | subj, data = mydata, strip=FALSE, panel = function(x, y,...) { panel.xyplot(x, y,...) panel.text(1,21,labels=which.packet()) })
The last bit ... where I gathered ... how to print letters instead of numbers in each panel. I would like to name the panels a, b, c ... etc.
Any suggestions ... Thanks a lot matteo
r lattice
matteo
source share