use_diary {campfin}R Documentation

Create a new template data diary

Description

Take the arguments supplied and put them into the appropriate places in a new template diary. Write the new template diary in the supplied directory.

Usage

use_diary(
  st,
  type,
  author,
  path = "state/{st}/{type}/docs/{st}_{type}_diary.Rmd",
  auto = FALSE
)

Arguments

st

The USPS state abbreviation. State data only, no federal agencies.

type

The type of data, one of "contribs", "expends", "lobby", "contracts", "salary", or "voters".

author

The author name of the new diary.

path

The file path, relative to your working directory, where the diary file will be created. If you use NA, then the lines of the diary will be returned as a character vector. If you specify a character string file path that contains directories that do not exist then they will be created. By default, the path creates the diary in a directory that is expected by the Accountability Project GitHub repository.

auto

Must be set to TRUE for the diary to be created and opened.

Value

The file path of new diary, invisibly.

Examples

use_diary("VT", "contribs", "Kiernan Nicholls", NA, auto = FALSE)
use_diary("DC", "expends", "Kiernan Nicholls", tempfile(), auto = FALSE)

[Package campfin version 1.0.11 Index]