Skip to content
Prev 367307 / 398506 Next

single strip for the same group in dotplot lattice

Dear Duncan and Philip,
thank you for your answers. maybe the toy data I gave it is a bit too easy,
so I am attaching a new dataset with 5 targets. As you can see from it, now
there are 5 panel strips with the label "run_1" and 5 with the label
"run_2". What I would like to do is to merge those with the same label so
to have only two labels "run_1" and "run_2".
the examples from Duncan contains plenty of keys but I think make the
reading of the plot more difficult; most of the plots have only one strip.
thank you
luigi
# the values are actually repeated, but they are just for example
cluster <- c(rep("run_1", 45), rep("run_2", 45))
type <- rep(c("blank", "positive", "negative"),30)
target <- rep(c(rep("A", 3), rep("B", 3), rep("C", 3), rep("D", 3),
rep("E", 3)), 6)
value <- rep(c(rnorm(1, mean=0.001, sd=0.1), rnorm(1, mean=2, sd=1),
rnorm(1, mean=1, sd=1)),30)
my.data <- data.frame(cluster, type, target, value)

library(lattice)
dotplot(
  value ~ type|target + cluster,
  my.data,
  groups = type,
  pch=21,
  main = "Luminex analysis MTb humans",
  xlab = "Target", ylab = "Reading",
  col = c("grey", "green", "red"),
  par.settings = list(strip.background = list(col="paleturquoise")),
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  key = list(
    space = "top",
    columns = 3,
    text = list(c("Blank", "Negative", "Positive"), col="black"),
    rectangles = list(col=c("grey", "green", "red"))
  )
)
On Thu, Feb 23, 2017 at 2:50 AM, Duncan Mackay <dulcalma at bigpond.com> wrote: