Skip to content

Instantly share code, notes, and snippets.

@akshaycuhk
akshaycuhk / gist:01576c57149a9a3d14514c9a3c4b4b1d
Created June 9, 2016 15:21
Below is a link to my code for forestplot. Basically, this is a code adapted from Abhijit's code and apatheme added from here: https://sakaluk.wordpress.com/2016/02/16/7-make-it-pretty-plots-for-meta-analysis/
#My APA-format theme
apatheme=theme_bw()+
theme(panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
panel.border=element_blank(),
axis.line=element_line(),
text=element_text(family='Times'),
legend.position='bottom', axis.text=element_text(size=14),
@webbedfeet
webbedfeet / credplot.R
Last active July 31, 2019 06:25
Forest plots using R and ggplot2
credplot.gg <- function(d){
# d is a data frame with 4 columns
# d$x gives variable names
# d$y gives center point
# d$ylo gives lower limits
# d$yhi gives upper limits
require(ggplot2)
p <- ggplot(d, aes(x=x, y=y, ymin=ylo, ymax=yhi))+
geom_pointrange()+