Skip to content

Instantly share code, notes, and snippets.

@lmullen
Created March 26, 2014 00:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmullen/9774152 to your computer and use it in GitHub Desktop.
Save lmullen/9774152 to your computer and use it in GitHub Desktop.
Attribution function for R
# An attribution function adapted from Kieran Healy
attribution <- function(text = "Lincoln Mullen <http://lincolnmullen.com>",
size = 0.75, color = "gray10") {
require(grid)
pushViewport(viewport())
grid.text(label = text ,
x = unit(1, "npc") - unit(2, "mm"),
y = unit(2, "mm"),
just = c("right", "bottom"),
gp = gpar(cex = size, col = color))
popViewport()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment