Rhvt,
> I've a question considering a facet_grid.
> For example the two variables that are in the facet_grid are:
> 'vs', with values 0 and 1
> 'am', with values 0 and 1
>
> How can I change these facet-axis-titles into:
> 'Car engine: V' (0)
> 'Car engine: Straight' (1)
> 'Transmission: Automatic' (0)
> 'Transmission: Manual' (1)
If you look at ?facet_grid you will see labeller in the arguments. You
just need to define a custom labeller function. Something like I have
done below...
dd<-data.frame(vs=rep(c(0,1),each=5),am=rep(c(0,1),times=5),x=rnorm(10),y=rnorm(10))
mylabels <- function(variable,value){ll <-
list(vs=list("0"="V","1"="Straight"),
am=list("0"="Automatic","1"="Manual"));
return(ll[[variable]][as.character(value)])}
ggplot(dd,aes(x=x,y=y))+geom_point()+facet_grid(vs~am,labeller=mylabels)
Hope this helps,
Ron.