cs_load_year | R Documentation |
cs_load_year
is used to load a set of .csv
files
contained in the given directory. This should be used to load a full
year worth of data or a partial year. There should be no more than 12
files in a given path, and all should correspond to the same year. All
columns will be read in as character data in order to address inconsistencies
in how the data are created. When cs_collapse is executed, variables
will be converted numeric when doing so is applicable.
cs_load_year(path)
path |
A file path |
A year-list object containing 12 tibbles - one per month - worth of crime data stored within a list.
# create temporary directory
tmpdir <- tempdir()
fs::dir_create(paste0(tmpdir,"/data/"))
# load sample files into temporary directory
cs_example(path = paste0(tmpdir,"/data/"))
# prep sample files
cs_prep_year(path = paste0(tmpdir,"/data/"))
# load sample files
yearList17 <- cs_load_year(path = paste0(tmpdir,"/data/"))
# delete data
fs::dir_delete(paste0(tmpdir,"/data/"))
# print year-list object
yearList17
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.