Learn R Programming

rbranding (version 0.1.1)

get_template: Copy template files into project

Description

get_template copies example files from the package's templates directory into the user's current working directory or a specified subdirectory.

Usage

get_template(template_name = NULL, install_to = NULL)

Value

NULL. Called for its side effects: copying template files into the user's project directory.

Arguments

template_name

Optional string. Name of the template to use. Corresponds to a folder name templates/. If NULL (default) within an interactive session, the function will list available templates and prompt the user to select one.

install_to

Optional string. Directory where the example files should be copied. If NULL (default), the current working directory will be used.

Examples

Run this code
if (interactive()) {
  get_template() # prompts user to select an example
}

tmpdir <- file.path(tempdir(), "wastewater_test")
get_template(template_name = "shiny_wastewater", install_to = tmpdir)

# Cleanup
unlink(tmpdir, recursive = TRUE)

Run the code above in your browser using DataLab