I have a lattice plot of experimental data that has 4 datasets (i.e. 4 different subsets in "Config." below), each dataset subdivided according to the config and then also grouped within each test type according to wind direction, "Dir". I am able to set the shape of the points according to the grouping "Dir" across all plots but i cannot then set colours according to "Config" so that for example the first plot has all red points, the second plot has all blue points etc. I am using an xyplot in lattice and the code for the plot is:
xyplot(ach[,"F"]~ach[,"Ar_sqrt"] | Config., type=c("p"),ach, groups=Dir,
auto.key=list(TRUE, space="bottom", columns=4, padding.text=(8)),
Outer=TRUE, allow.multiple=TRUE, as.table=TRUE, scales=list(tick.number=10),
grid=TRUE, par.settings=simpleTheme(pch=points$shape, cex=1.75, col=1),
abline=list(c(0,0.2013), col=2, type="l"), layout=c(1,4),
panel = function( x,y,...) {
panel.abline(lm(y~x),col = "black", lwd=1)
panel.xyplot( x,y,...)
})
I cant attach an image as my rep is les sthan 10, apologies. I have come across different ways of setting colours, etc but they all seem to either use the grouping function.
the data set is available here, (i added columns for pch and col to try and use this but to no avail:
https://www.dropbox.com/sh/ug9kun9rycsb1fw/AABSXuMs9kEWSgeEAcTYhDkxa
any help or direction to duplicates i didnt find very much appreciated...
