Skip to contents

This function installs a set of R, HTML, JavaScript and CSS snippets that are helpful when developing Shiny apps and doing web development work in RStudio. By default, the snippets are installed where RStudio will find them. If you haven't previously installed snippets to RStudio, these snippets will mask some of the built-in snippets that ship with RStudio.

Usage

snippets_install(install_path = NULL, update = TRUE)

Arguments

install_path

Where should the snippets be installed? If NULL, the snippets will install to a default path based on the current version of RStudio.

update

Should existing snippets be updated in place if there are any conflicts? Default is yes (TRUE). Otherwise, new snippets are appended to the end of the existing file, ensuring that you can recover your previous snippets by editing the snippets file.

Updating Existing Snippets

If you already have snippets installed, you can you can have the installed snippets update the existing snippets in place with update = TRUE. Or you can append the new snippets to the existing snippets files with update = FALSE. This option is desirable if you want to make sure that no snippets are overwritten. The newer snippets will mask older snippets, but no data will be lost.

Examples

snip_tmp <- tempfile("snippets")
dir.create(snip_tmp)
snippets_install(snip_tmp)
#> The new css.snippets may mask the default RStudio snippets
#> Installed css.snippets
#> The new html.snippets may mask the default RStudio snippets
#> Installed html.snippets
#> The new javascript.snippets may mask the default RStudio snippets
#> Installed javascript.snippets
#> The new markdown.snippets may mask the default RStudio snippets
#> Installed markdown.snippets
#> The new r.snippets may mask the default RStudio snippets
#> Installed r.snippets