Skip to contents

This function allows you to easily copy and open a template from the package.

Usage

use_template(
  template_file = NULL,
  folder = fs::path_wd(),
  file_name = NULL,
  open = rlang::is_interactive(),
  overwrite = FALSE
)

Arguments

template_file

character. File name for a template.

folder

character. Where should the template be copied to? Default is the current working directory.

file_name

character. What should the copied file be called? Default is to use whatever value is supplied to template_file.

open

logical. Should the file be opened?

overwrite

logical. Should a file with the same name in the destination folder be overwritten?

Value

Character. If no template_file value is provided, lists all template files in the package. If a file is created, it returns the file path for that new file.

Examples


if (FALSE) { # \dontrun{
# makes a copy of the disease data template in the current working directory
use_template("disease_data_template.csv")
} # }