Skip to content
Prev 306307 / 398506 Next

lattice dotplot reorder contiguous levels

On Wed, Sep 26, 2012 at 3:36 PM, maxbre <mbressan at arpa.veneto.it> wrote:
For that, it should be enough to just reorder again by samp.time. Your
label code doesn't work then (I haven't tried to figure out why), but
your earlier idea using strsplit() does:


test$samp.time.new <-
    with(test, reorder(reorder(samp.time:site, as.numeric(site)),
                as.numeric(samp.time)))

lab <- sapply(strsplit(levels(test$samp.time.new), ":", fixed=TRUE), "[", 1)

dotplot(samp.time.new~conc|site, data=test,
        ylim=lab,
        scales=list(x=list(log=10), y = list(relation = "free")),
        layout=c(1,5), strip=FALSE, strip.left=TRUE
        )

-Deepayan