build_datasheet_path: Constructs a path to write an empty delimited file for...

View source: R/build_datasheet_path.R

build_datasheet_pathR Documentation

Constructs a path to write an empty delimited file for collecting data

Description

Used as a helper by my other packages; automatically appends the date to the end of the file path (prefixed by an underscore)

Usage

build_datasheet_path(stem, base = NULL, date = NULL, ext = "csv")

Arguments

stem

character vector of file stems, without extension

base

root of file; i.e. directory where it should be saved. Defaults to here::here() if not supplied

date

date for collection, defaults to today's date

ext

file extension, defaults to "csv" but also accepts "tsv" or "xlsx"; period optional; accepts a character vector of multiple formats if desired

Value

character vector of paths with length matching that of the stem argument

Examples

# sensible defaults allow for minimal typing
build_datasheet_path(stem = "my-precious-data")

# or write to tab-delimited file
build_datasheet_path(stem = "my-precious-data", ext = "tsv")

# or make many sheets at once using multiple stems and multiple formats

build_datasheet_path(stem = paste("my-precious-data", 1:3, sep = "-"))

# multiple formats can be created with one call
build_datasheet_path(stem = "my-precious-data", ext = c("csv", "tsv"))



evanmascitti/ecmfuns documentation built on April 5, 2025, 1:52 a.m.