Learn R Programming

starter (version 0.1.16)

use_project_file: Write a template file

Description

Rather than using create_project() to start a new project folder, you may use use_project_file() to write a single file from any project template. The functions use_project_gitignore() and use_project_readme() are shortcuts for use_project_file("gitignore") and use_project_file("readme").

Usage

use_project_file(
  name = NULL,
  filename = NULL,
  template = NULL,
  open = interactive()
)

use_project_gitignore(filename = NULL, template = NULL)

use_project_readme(filename = NULL, template = NULL)

Value

NULL, places single template file in current working directory

Arguments

name

Name of file to write. Not sure of the files available to you? Run the function without specifying a name, and all files available within the template will print.

filename

Optional argument to specify the name of the file to be written. Paths/filename is relative to project base

template

A project template. See vignette for details.

open

If TRUE, opens the new file.

See Also

Examples

Run this code
# only run fn interactively, will place files in current working dir
if (interactive()) {
  # create gitignore file
  use_project_file("gitignore")
  use_project_gitignore()

  # create README.md file
  use_project_file("readme")
  use_project_readme()
}

Run the code above in your browser using DataLab