I would like to have the ggplot only display levels where there is data. So for the first facet S7, S8, S9 should not appear & for the second facet S1, S2, S3 should not appear. Please let me know if I articulated myself correctly.
df = data.frame(v1 = c('A','A','A','B','B','B'),
v2 = c('S1','S2','S3','S7','S8','S9'),
nm = c(2,3,4,5,6,7))
ggplot(df,aes(x = v2, y = nm)) +
geom_point(size = 3) +
facet_grid(.~v1)