My Snippets For RStudio (or Elsewhere) - GitHub

Skip to content Dismiss alert {{ message }} / snippets Public
  • Notifications You must be signed in to change notification settings
  • Fork 6
  • Star 22
  • Code
  • Issues
  • Pull requests 1
  • Actions
  • Projects
  • Security
  • Insights
Additional navigation options  mainBranchesTagsGo to fileCode

Folders and files

NameNameLast commit messageLast commit date

Latest commit

 

History

37 Commits
README.mdREADME.md  
css.snippetscss.snippets  
html.snippetshtml.snippets  
markdown.snippetsmarkdown.snippets  
r.snippetsr.snippets  
View all files

Repository files navigation

  • README

Snippets for RStudio

Various custom snippets designed for RStudio, but possibly useful elsewhere.

Copy the snippets into the correct language file from the Global Options > Code > Edit Snippets menu.

Or use dgrtwo/snippr to install:

# remotes::install_github("dgrtwo/snippr") library(snippr) # For all snippets snippets_install_github("gadenbuie/snippets") # For just the R snippets snippets_install_github("gadenbuie/snippets", language = "r") # For just an individual snippet snippets_install_github("gadenbuie/snippets", language = "r", name = "aa")

For manual installation, copy the snippets to ~/.R/snippets/r.snippets or ~/.config/rstudio/snippets for RStudio 1.3. (Windows uses a different directory that I don't know off the top of my head, sorry.). usethis::edit_rstudio_snippets() may provide better advice.

local({ snippets_dir <- fs::path_home(".config", "rstudio", "snippets") fs::dir_create(snippets_dir) # make sure ~/.R/snippets exists gh_base_url <- "https://raw.githubusercontent.com/gadenbuie/snippets/main/" for (snippet in paste0(c("r", "markdown", "css", "html"), ".snippets")) { download.file( paste0(gh_base_url, snippet), fs::path(snippets_dir, snippet) ) } })

You may be able to find other useful snippets using this GitHub search.

About

My snippets for RStudio (or elsewhere)

Topics

snippets r rstudio rstats

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

22 stars

Watchers

1 watching

Forks

6 forks Report repository

Releases

No releases published

Packages

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

  • Vim Snippet 100.0%
You can’t perform that action at this time.

Tag » Code Snippets R Markdown