[R] Violin plot for discrete variables.

2005-03-21 Thread Witold Eryk Wolski
Dear Rgurus, To my knowledge the best way to visualize the distribution of a discrete variable X is plot(table(X)) The problem which I have is the following. I have to discrete variables X and Y which distribution I would like to compare. To overlay the distribution of Y with lines(table(Y)) gi

RE: [R] Violin plot for discrete variables.

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

Re: [R] Violin plot for discrete variables.

2005-03-21 Thread Gabor Grothendieck
Witold Eryk Wolski ncl.ac.uk> writes: : : Dear Rgurus, : : To my knowledge the best way to visualize the distribution of a discrete : variable X is : plot(table(X)) : : The problem which I have is the following. I have to discrete variables : X and Y which distribution I would like to compar

RE: [R] Violin plot for discrete variables.

2005-03-21 Thread Martin Maechler
> "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, .

Re: [R] Violin plot for discrete variables.

2005-04-09 Thread Deepayan Sarkar
On Monday 21 March 2005 11:08, Martin Maechler wrote: > > "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> x