cs_example: Load Example Files

View source: R/example.R

cs_exampleR Documentation

Load Example Files

Description

Adds a sample set of twelve files, one for each month of 2017, to the specified path. These are not full data files; each file has twenty observations. They can be used to practice preparing, loading, standardizing, and collapsing data.

Usage

cs_example(path, overwrite = FALSE)

Arguments

path

File path where example data should be placed

overwrite

Overwrite files if they exist. If this is FALSE and the file exists an error will be thrown.

Examples

# create temporary directory
tmpdir <- tempdir()
fs::dir_create(paste0(tmpdir,"/data/"))

# load sample files into temporary directory
cs_example(path = paste0(tmpdir,"/data/"))

# list files
list.files(paste0(tmpdir,"/data/"))

# delete data
fs::dir_delete(paste0(tmpdir,"/data/"))


chris-prener/compStatR documentation built on Jan. 25, 2024, 10:03 p.m.