snippets_install: Install councilR snippets

View source: R/snippets.R

snippets_installR Documentation

Install councilR snippets

Description

This function installs a set of R snippets that are helpful when working with Metropolitan Council projects in 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

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

update

logical, 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.

Details

Snippets will only appear when writing in the snippet's language. For example, HTML snippets will not appear while editing a ".R" file, but will appear when editing a ".html" 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.

Note

This function is adapted from js4shiny::snippets_install()

Author(s)

Garrick Aden-Buie g.adenbuie@gmail.com, Liz Roten liz.roten@metc.state.mn.us

See Also

Other spatial helpers: fetch_county_geo()

Examples

## Not run: 
snip_tmp <- tempfile("snippets")
dir.create(snip_tmp)
snippets_install(snip_tmp)

## End(Not run)


Metropolitan-Council/councilR documentation built on March 30, 2024, 2:43 a.m.