I am trying to change the names of the panel from 0, 1, 4, ... to c("Gl", "RC", "4", "9", "16", "25" "36", "49). I have tried the labeller function but that gives "NA". Any help or direction to start is truly appreciated.
library("ggplot2")
library(reshape2)
#####################################################
req<-c(sapply(seq(0, 7) , function (x) x**2))
err2<-c( 0.62,0.48, 0.64, 0.61, .77, .79, 0.82, 0.82)
An2<-rep( c("II"), each=(length(req+1)))
data2<-data.frame(req, ErrorRate=err2, Analysis=An2)
##############################################
err3<-c(0.66, .46, .69, .62, .74, .79, .81, 0.78) #.79
An3<-rep( c("III"), each=(length(req+1)))
data3<-data.frame(req,ErrorRate=err3, Analysis=An3)
###########################
dat1<-rbind( data2, data3)
##############################
P<-ggplot() +
geom_bar(data= dat2, aes(y =ErrorRate, x = "", fill = Analysis),
stat="identity", color="black",
position = position_dodge(.9)) + theme_bw()
P+facet_grid(.~ factor.req., scales="free")