batch_load | R Documentation |
Quickly load a large mixed set of files into R environment.
batch_load(
path,
file_list,
env = .GlobalEnv,
haven_arg = list(),
readxl_arg = list(),
csv_arg = list(),
fst_arg = list(),
rds_arg = list(),
readr = TRUE
)
path |
character vector defining the directory containing files to load. |
file_list |
character vector of files within directory to load. |
env |
R environment to assign data to; default set to |
haven_arg, readxl_arg, csv_arg, fst_arg, rds_arg |
additional parameters passed to load functions depending on file extension. |
readr |
boolean value to determine if |
This is only useful if all the files can be loaded with similar parameters. If certain columns or rows needs to be dropped during loading, then it may be best to load those separately. The use-case with the {relay} package is to provide a way to quickly take data files from a bundle into the environment. Loaded data will be assigned to the global environment by default with their names all in lower-case.
Files with the following extensions can all be loaded at the same time:
sas7bdat via {haven}
xlsx via {readxl}
csv via {utils} or {readr}
rds via {base}
Please note: when loading more troublesome/complex data, it may be easier to use the appropriate load functions directly.
data-sets assigned to designated R environment.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.