Skip to content
Prev 351420 / 398502 Next

metagen - plotStudySizes: order by year and not alphabetical

Yes you can do it fairly easily in 'basic' ggplot2.  You need to change the references from factors to ordered factors and then plot.

Note your data is now called dat1 as df is an R function. Do ?df to see what it is.

dat1$reference  <- factor(dat1$reference, levels = dat1$reference[order(dat1$year)])
p1  <-  ggplot(dat1, aes( reference, size)) + geom_bar( stat = "identity") + coord_flip()
 p2   <- p1 + ggtitle("Studies with Cross-sectional estimates")
p2


I hope this helps
John Kane
Kingston ON Canada
____________________________________________________________
FREE 3D MARINE AQUARIUM SCREENSAVER - Watch dolphins, sharks & orcas on your desktop!