>>>>> "AndyL" == Liaw, Andy <[EMAIL PROTECTED]>
>>>>>     on Mon, 21 Mar 2005 08:14:20 -0500 writes:

    AndyL> I'd suggest dotcharts, such as:
    AndyL> x1 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.2, .3, .4, .1))
    AndyL> x2 <- sample(letters[1:4], 100, replace=TRUE, prob=c(.1, .4, .3, .2))
    AndyL> f1 <- table(x1) / length(x1)
    AndyL> f2 <- table(x2) / length(x2)
    AndyL> lev <- factor(c(names(f1), names(f2)))
    AndyL> require(lattice)

    AndyL> dotplot(lev ~ c(f1, f2), groups=rep(1:2, c(length(f1), length(f2))),
    AndyL>         panel=panel.superpose)

yes. Maybe slightly even more useful --- and closer to the 
plot(table(.)), ...) that Witold mentioned would be the
following slight variation:

dotplot(lev ~ c(f1, f2), groups=rep(1:2, c(length(f1), length(f2))),
        panel=panel.superpose, type =c("p","h"))

Note the nice lattice feature (thanks to Deepayan Sarkar!) of
allowing type to be a union of two basic types.

Martin

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to