There is an example provided here, but I just can't make it work. Here is my use case:
df <- as.data.frame(matrix(runif(9),8,8))
angles <- c(0.112, 2.633, 3.766, 5.687, 0.867, 7.978, 8.937, 4.652)
df$factor <- as.factor(angles)
df.m <- melt(df)
ggplot(df.m, aes(variable, value)) +
geom_boxplot() +
facet_wrap(~factor)
Now I want to display rounded angles with the degree symbol. So I tried this
new.labs <- as_labeller(paste(round(as.numeric(angles)), "degree"), label_parsed)
ggplot(df.m, aes(variable, value)) +
geom_boxplot() +
facet_wrap(~factor, labeller=new.labs)
But it produces empty strings.