[R] help with creating a box plot

Adrian Johnson oriolebaltimore at gmail.com
Fri May 18 19:41:32 CEST 2012


Hi:

I am looking for some help in making two boxplots next to each other.


I have a data like this:

N1   T1   N2   T2   N3   T3   N4   T4  ... Nn  Tn
7     8.2   4     5     8    10    4     5 .....  10   11

I want to have box plot for all Normal samples (N1,N2,N3,N4,,,,Nn)
and another box plot for all tumors (T1,T2,T3,T4,...Tn).

I have data in a numeric class.


If data is represented as N1 N2 N3 N4 T1 T2 T3 T4 I can do something
like the following:

if x object is my data matrix

boxplot(x ~ c(rep('N',n),rep('T',n)), ylim=ylim, main=title)


since the data is arranged as N1 T1, I don't know how to use boxplot
function on tumor-normal lable.

 Could any one help me please.
thanks
Adrian



More information about the R-help mailing list