Learn R Programming

compstatr (version 0.2.1)

cs_example: 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

Run this code
# NOT RUN {
# 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/"))

# }

Run the code above in your browser using DataLab