2

I have got a box plot showing the relationship. However, I could not manage to name the variable names on the plot. Does any one know how to do so? Here is the R code:

set.seed(2)
x1 <- sample(rep(1:5,2))
x2 <- sample(rep(1:5,2))
x3 <- sample(rep(1:5,2))
x4 <- sample(rep(1:5,2))
x5 <- sample(rep(1:5,2))
y <- runif(10,-1,1)

d <- data.frame(y,x1,x2,x3,x4,x5)
library(reshape2)
dm <- melt(d,id.var=1)
library(ggplot2)
ggplot(dm,aes(x=value,y=y))+geom_boxplot(aes(group=value))+
facet_wrap(~variable,nrow=1)

enter image description here

I want to write weather and pollution instead of weather. How could I do that?

Günal
  • 751
  • 1
  • 14
  • 29
  • What have you tried? Did you search SO for other questions about renaming facet labels? [like this one](http://stackoverflow.com/questions/3472980/ggplot-how-to-change-facet-labels)? – Justin May 29 '13 at 15:43
  • To be honest, I have not tried anything as I don't have any idea on this matter :( – Günal May 29 '13 at 15:48

0 Answers0