David Winsemius
On Mar 4, 2009, at 1:50 PM, soeren.vogel at eawag.ch wrote:
> Pls forgive me heavy-handed data generation -- newby ;-)
>
> ### start ###
> # example data
> g <- rep.int(c("A", "B", "C", "D"), 125)
> t <- rnorm(5000)
> a <- sample(t, 500, replace=TRUE)
> b <- sample(t, 500, replace=TRUE)
>
> # what I actually want to have:
> boxplot(a | b ~ g)
>
> # but that does obviously not produce what I want, instead
> i <- data.frame(g, a, rep("one", length(g)))
> j <- data.frame(g, b, rep("two", length(g)))
> names(i) <- c("Group", "Number", "Word")
> names(j) <- c("Group", "Number", "Word")
> k <- as.data.frame(rbind(i, j))
> boxplot(k$Number ~ k$Word * k$Group)
> ### end ###
>
> Questions: (1) Is there an easier way? (2) How can I get additional
> space between the A:D groups?
>
> Thank you
>
> S?ren
>
> ______________________________________________
> 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.