[R] Boxplot questions.

A Ezhil ezhil02 at yahoo.com
Tue Jun 27 13:45:01 CEST 2006


Dear all,

I am having a data for 2 different treatments with
different time points. So, I used the following code
to plot the boxplot and also to do anova. 

T11 <- c(280, 336, 249, 277, 429)
T12 <- c(400, 397, 285, 407, 313)
T13 <- c(725, 373, 364, 706, 249)

T21 <- c(589, 257, 466, 248, 913)
T22 <- c(519, 424, 512, 298, 907)
T23 <- c(529, 479, 634, 354, 1015)

obs <- c(T11, T12, T13, T21, T22, T23)
treat <- c(rep("T1",15), rep("T2",15))
time <- c(rep("one",5), rep("two",5), rep("thr",5),  
          rep("one",5), rep("two",5), rep("thr",5)  
         )

table <- data.frame(obs, treat, time)
boxplot(obs ~ treat*time, data=table)

I am able to produce a boxplot for the above data. 
(1) If I want to add a color to T1 and different color
to T2, what are the options I should use?
(2) my prof. asked me to add '*' above the boxplot, if
the comparison is significant. How do I add this '*'
in the boxplot? 

I used: anova(lm(obs ~ treat*time, data=table)) for
finding significance.

Any help is greatly appreciated. Thanks in advance.

Regards,
Ezhil



More information about the R-help mailing list