Manage, share, and install RStudio code snippets
R
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
inst/test_data Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
man-roxygen Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
man Adjustment to .Rd Apr 14, 2015
tests Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
vignettes Adjustments to vignettes and README Apr 14, 2015
.Rbuildignore Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
.gitignore Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
DESCRIPTION
NAMESPACE Initial commit of snippr package. Includes some tests, vignettes, and… Apr 14, 2015
README.Rmd
README.md README adjustment Apr 14, 2015
snippr.Rproj

README.md

snippr: publish, install, and share RStudio code snippets

snippr provides tools to manage and install RStudio code snippets, including installing them from public repositories.

Setup

You can install snippr with the devtools package:

devtools::install_github("dgrtwo/snippr")

Sharing and installing snippets

snippr lets you share RStudio snippets with others by publishing them as a GitHub repository or a Gist.

To share your snippets, create a GitHub repository with one or more .snippets file at the top level: see the dgrtwo/snippets repository for an example. Anyone can then install your snippets using the code:

library(snippr)
snippets_install_github("dgrtwo/snippets")

Note that you may need to restart RStudio for the snippets to load. If you want to install only for one of the languages in the repo, you can use the language argument:

snippets_install_github("dgrtwo/snippets", language = "r")

Or you can choose to install only a single snippet:

snippets_install_github("dgrtwo/snippets", language = "r", name = "S3")

If you prefer, you can share one .snippets file as a GitHub Gist (like this one), and install it with its ID:

snippets_install_gist("ecc6aec8d37af42cdd83", language = "r")

See the vignettes for more.