# Loading libraries
library(lattice)
library(latticeExtra)
library(gplots)
library(Hmisc)
library(memisc)
dat <- pds
dat$Dilution <- rep(c(rep(c(10^(4:-1),0), each = 4),
"NGC", "NGC", "NTC", "NTC"), 2)
print(xyplot(Concentration ~ factor(Dilution, levels=Dilution), dat,
groups = Assay, ewidth = 0.08, ylim = c(10^-1.5, 10^4.5),
ylab = "Concentration cp / micro L", xlab = "Theoretical plasmid
concentration [cp/micro L]", strip = FALSE,
scales = list(y = list(log = 10), alternating = FALSE),
panel = function(x, y, groups = groups, ...) {
panel.rect(7.5,-2, 10,5, col = grey(0.9), border = NA)
panel.grid(h = -1,v = -1, col = grey(0.8), lty = 2)
panel.xyplot(x, y, groups = groups, col = grey(0.6), ...)
panel.key(c("IleS", "StyA"), corner = c(0.95,0.95))
means <- tapply(y, list(x, groups), function(x) mean(x, na.rm = TRUE))
stdev <- tapply(y, list(x, groups), function(x) sd(x, na.rm = TRUE))
panel.errbars(1:9 + 0.25, y = cbind(means[, 1],
means[, 1]-stdev[, 1], means[, 1] + stdev[, 1]),
make.grid = "none", pch = 1,...)
panel.errbars(1:9 + 0.25, y = cbind(means[, 2],
means[, 2] - stdev[, 2], means[, 2] + stdev[, 2]),
make.grid = "none", pch = 3, ...)
panel.abline(a = c(5,-1), lty = 2, col = 2)
}
)
)
Run the code above in your browser using DataLab