Is it possible to drop levels that are not used in ggplot2s facets? This is my code:
tab = as.data.frame(cbind(groups = mtcars$cyl, names = row.names(mtcars), val = mtcars$mpg, N = mtcars$disp))
tab$N = as.numeric(tab$N)
ggplot(tab, aes(names,val)) +
geom_point() + coord_flip() +
theme_bw() +
facet_grid(groups ~ ., drop=TRUE)#, scales="free", as.table=F, space="free")
I tried the drop=T
switch but it doesnt help. What am I doing wrong?