cs_example: Load Example Files

Description Usage Arguments Examples

View source: R/example.R

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# 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/"))

compstatr documentation built on July 8, 2020, 7:34 p.m.