Skip to content
Prev 367333 / 398506 Next

single strip for the same group in dotplot lattice

Dear all,
Duncan has provided a splendid example that works within lattice that
sorted the problem. For sake of argument I will report the updated script
with the solution (the optimum now would be to customize the label of the
outer strips); this new version requires latticeExtra and uses the
useOuterStrips function:
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)
library(latticeExtra)
useOuterStrips(
  strip = strip.custom(par.strip.text = list(cex = 0.75)),
  strip.left = strip.custom(par.strip.text = list(cex = 0.75)),
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"))
  )
)
)

<<<
also, the answer provided by Paul does the job all right, but uses the
package grid instead of lattice. The stripless package (Bert Gunter's
suggestion) might be another approach but again require to study the code
in detail.
Thank you all very much indeed for  your support,
Luigi

On Thu, Feb 23, 2017 at 9:00 AM, Luigi Marongiu <marongiu.luigi at gmail.com>
wrote: