Hi I have a vector of data lets call zz (40 values from 4 samples) the data is already in groups, i can even split up the samples using SampA <- zz[,2:11] SampB <- zz[,12:21] SampC <- zz[,22:31] SampV <- zz[,32:41] I would like an output that gives me 4 boxplots on one plot one boxplot for the set of 10 values how can i do this in R
help wth boxplots
3 messages · Amit Patel, PIKAL Petr, Michael Lawrence
Hi r-help-bounces at r-project.org napsal dne 26.05.2009 15:34:25:
Hi I have a vector of data lets call zz (40 values from 4 samples)
Are you sure it is a vector? Your indexing suggest data frame or matrix.
the data is already in groups, i can even split up the samples using SampA <- zz[,2:11] SampB <- zz[,12:21] SampC <- zz[,22:31] SampV <- zz[,32:41] I would like an output that gives me 4 boxplots on one plot one boxplot for the set of 10 values how can i do this in R
maybe boxplot(list(SampA, SampB, SampC, SampV)) but there are more effective ways if you had other data structure e.g. 4 column data frame boxplot(data.frame(rnorm(10), rnorm(10), rnorm(10), rnorm(10))) or list boxplot(list(rnorm(10), rnorm(10), rnorm(10), rnorm(10))) or even a vector of indices for different groups boxplot(split(rnorm(40), rep(letters[1:4],10)) Regards Petr
______________________________________________ R-help at r-project.org mailing list 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.
check out ggplot2: http://had.co.nz/ggplot2/ particularly: http://had.co.nz/ggplot2/geom_boxplot.html
On Tue, May 26, 2009 at 10:34 AM, Amit Patel <amitrhelp at yahoo.co.uk> wrote:
Hi I have a vector of data lets call zz (40 values from 4 samples) the data is already in groups, i can even split up the samples using SampA <- zz[,2:11] SampB <- zz[,12:21] SampC <- zz[,22:31] SampV <- zz[,32:41] I would like an output that gives me 4 boxplots on one plot one boxplot for the set of 10 values how can i do this in R
______________________________________________ R-help at r-project.org mailing list 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.
Mike Lawrence Graduate Student Department of Psychology Dalhousie University Looking to arrange a meeting? Check my public calendar: http://tr.im/mikes_public_calendar ~ Certainty is folly... I think. ~