knitr::opts_chunk$set( collapse = TRUE, results = "asis", echo = FALSE, comment = "#>", out.width = "100%" ) IS_README <- TRUE
A shiny gadget for interactively annotating a ggplot. Currently supports:
You can install the development version of the package via GitHub:
devtools::install_github('jhelvy/gglabelr')
First, load the libraries and create a plot using ggplot
library(gglabelr) library(ggplot2) p <- ggplot(mpg, aes(x = hwy, y = displ)) + geom_point()
Use the gglabelr()
function to interactively annotate the plot:
gglabelr(p)
Copy the code to produce the annotations in the "Get the code" tab. The code will also print to the console when you close the app by pressing the "done" button.
r format(Sys.Date(), format="%B %d %Y")
If you use this package for in a publication, I would greatly appreciate it if you cited it. You can get the citation information by typing citation("gglabelr")
into R:
citation("gglabelr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.