snippr v0.0.0.9000

Manage, share, and install RStudio snippets

Manage, share, and install snippets for the RStudio IDE. Allows snippets to be added and installed from GitHub repositories or gists.

Readme

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.

Functions in snippr

Name Description
snippet_prepare Prepare a snippet for a .snippets file.
snippets_install_gist Install one or more snippets from a GitHub Gist
github_GET GET request to GitHub
snippets_parse Parse a character vector of snippets.
snippets_add Add a list of snippets to a .snippets file.
snippets_install_url Install one or more snippets from a URL.
snippets_install_github Install one or more snippets from a GitHub repository
snippets_get Retrieve a current snippet
snippet_remove Remove a snippet from a .snippets file.
snippet_add Add a snippet to a .snippets file.
snippets_write Write a list of snippets to a file.
snippets_path Find the path to a .snippets file.
snippets_read Parse the current snippets file into a list of snippets.
No Results!

Vignettes of snippr

Name
installing.Rmd
snippet_files.Rmd
No Results!

Details

Type Package
Date 2015-04-13
License GPL (>= 2)
LazyData TRUE
URL http://github.com/dgrtwo/snippr
BugReports http://github.com/dgrtwo/snippr/issues
VignetteBuilder knitr

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/snippr)](http://www.rdocumentation.org/packages/snippr)