[R] Adjusting format of boxplot

David Arnold dwarnold45 at suddenlink.net
Thu Jul 12 23:13:42 CEST 2012


Hi,

I managed to use the attached data set and figure out the following:

flies <- read.table("example12_1.dat",header=TRUE,sep="\t")
boxplot(long ~ group,
        data = flies,
        horizontal = TRUE,
        col = "red")

I'm very new to R and would like some help with the following:

1. Change the order on the y-axis from 1, 2, 3, 4, 5 to 5, 4, 3, 2, 1. In other words, I want the bottom boxplot on top.

2. I want the y-axis labels 1, 2, 3, 4, 5 to read Group 1, Group 2, Group 3, Group 4, and Group 5, and I would like them to be horizontal; i.e. parallel to the boxplots.

3. I'd like the tick marks and labels on the horizontal axis to go from 10 to 110 by 20's.

4. Finally, I want to turn off the frame surrounding the image, but not the horizontal axis and its tick marks and labels.

I appreciate the help.

Thanks.

David





More information about the R-help mailing list