Skip to content
Prev 367301 / 398506 Next

single strip for the same group in dotplot lattice

Hi Liugi

Here are some ideas quickly

4 panels diagonals are blank

mdata = my.data
mdata$ct <- paste(target, "Run", rep(1:2, each = 6))
mdata$typeT <- paste(mdata$target,mdata$type)

dotplot(
  value ~ type|ct,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
                      superpose.symbol = list(col = c(2:4),
                                              pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)

# for when the 4 panels have plots not 2 as now
 mdata2 = mdata
 mdata2$target = rep(LETTERS[2:1], ea=6)
 mdata2$value= mdata2$value+0.1
 mdata2 <- rbind(mdata,mdata2)

mdata2$typeT <- paste(mdata2$target,mdata2$type)

 dotplot(
   value ~ type|target + cluster,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
                       superpose.symbol = list(col = c(2:4),
                                               pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )


 dotplot(
   value ~ type|ct,
   mdata2,
   groups = typeT,
   par.settings = list(strip.background = list(col="paleturquoise"),
                       superpose.symbol = list(col = c(2:4),
                                               pch = rep(c(1,20),each =
3))), # type
   scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
   main = "Luminex analysis MTb humans",
   strip    = strip.custom(factor.levels = paste("Run",1:2),
                        par.strip.text = list(cex = 1) ),
   xlab = "Target", 
   ylab = "Reading",
   auto.key = T,
   panel = panel.superpose
 )

dotplot(
  value ~ type|cluster,
  mdata2,
  groups = typeT,
  par.settings = list(strip.background = list(col="paleturquoise"),
                      superpose.symbol = list(col = c(2:4),
                                              pch = rep(c(1,20),each = 3))),
# type
  scales = list(alternating = FALSE, x = list(labels = c("", "", ""))),
  main = "Luminex analysis MTb humans",
  xlab = "Target", 
  ylab = "Reading",
  auto.key = T,
  panel = panel.superpose
)


Regards

Duncan

-----Original Message-----
From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Luigi
Marongiu
Sent: Wednesday, 22 February 2017 21:26
To: P Tennant; r-help
Subject: Re: [R] single strip for the same group in dotplot lattice

Dear Philip,
the data is indeed a toy data: the real one will have 15 panels (=targets)
and two or three clusters. this means that I will have 15 strips with the
label "run 1" = "cluster 1" etc. the point of the toy data is that I get a
4x4 panel plot with 8 strips labelled "run 1", "run 2", "A" and "B". What I
am looking for is to collapse the strips so to get only one label "run 1"
and only one with "run 2" in order to simplify the plot. Hope this helps.
Thanks
Luigi
On Wed, Feb 22, 2017 at 9:53 AM, P Tennant <philipt900 at iinet.net.au> wrote:

            
1"
______________________________________________
R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.