Skip to content
Prev 306005 / 398506 Next

lattice dotplot reorder contiguous levels

On Thu, Sep 20, 2012 at 7:48 PM, maxbre <mbressan at arpa.veneto.it> wrote:
The problem here is that there is crossing between sites and
samp.time. You can try some imaginative permutations of site, such as

test$samp.time.new <- with(test, reorder(samp.time,
as.numeric(factor(site, levels = c("A", "C", "D", "B", "E")))))

which gets all but site B right. There may be another permutation that
works for everything, but it would be much easier to make a nested
factor, i.e.,

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

That just leaves getting the y-labels right, which I will leave for
you to figure out.

(Hint: ylim = some_function_of(levels(test$samp.time.new)))

-Deepayan