[R] boxplot question

Laurent Gautier Laurent.Gautier at lionbioscience.com
Thu Apr 6 18:03:39 CEST 2000


Two boxplots at the same abscisse... (?!?)

If I understood clearly, you want to have a glance at the dispersion of your
values, in each category, and for both of your methods.



The following could do the job...



#build a fake data set
val.control <- seq(1,100)
val.exp <- seq(51,150)
lev.control <- as.factor(rep(c("a","b","c"),length.out=length(val.control)))
lev.exp <- as.factor(rep(c("a","b","c"),length.out=length(val.exp)))


# REM : this cheap thing works when there are the same number of exp and controls

lev.control <- paste(as.character(lev.control),".co",sep='')
lev.exp <- paste(as.character(lev.exp),".exp",sep='')
lev.all <- rbind(as.character(lev.control),as.character(lev.exp))
val.all  <- rbind(as.vector(val.control),as.vector(val.exp))
dim(lev.all)_length(lev.all)
dim(val.all)_length(val.all)
myColors <- rep(c("red","blue"),length.out=length(val.all))

boxplot(val.all ~ as.factor(lev.all),col=myColors)





Laurent

PS: There must be a more elegant way to do this...



Christine Serres wrote:

> Hi,
>
> Can anyone tel me how to plot two boxplot at the same abscisse value ?
> Because I want to compare the discrimination of two different biological
> methods of the same data.
>
> Thanks
>
> Christine
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list