Skip to content

Instantly share code, notes, and snippets.

View ronrest's full-sized avatar

Ronny Restrepo ronrest

View GitHub Profile
@shenqi
shenqi / ggplot2_lm.R
Last active August 29, 2015 14:01
Extension of ggplot2 to work friendly with lm object
library(ggplot2)
require(ggplot2)
# usage
#
# stat_r2(lm_obj, x, y, adjusted = FALSE, digits=NULL, ...)
# lm_obj lm object given by lm()
# x, y positional coordinate of r2 value
# adjusted use adjusted R2 instead
# digits see format()