load_csv {tor} | R Documentation |
Import multiple common files from a directory into an environment.
Description
These functions wrap common use-cases of load_any()
.
Usage
load_csv(
path = ".",
regexp = "[.]csv$",
ignore.case = TRUE,
invert = FALSE,
envir = .GlobalEnv,
...
)
load_tsv(
path = ".",
regexp = "[.]tsv$",
ignore.case = TRUE,
invert = FALSE,
envir = .GlobalEnv,
...
)
load_rds(
path = ".",
regexp = "[.]rds$",
ignore.case = TRUE,
invert = FALSE,
envir = .GlobalEnv
)
load_rdata(
path = ".",
regexp = "[.]rdata$|[.]rda$",
ignore.case = TRUE,
invert = FALSE,
envir = .GlobalEnv
)
Arguments
path |
A character vector of one path. Defaults to the working directory. |
regexp |
A regular expression (e.g. |
ignore.case |
if |
invert |
If |
envir |
an |
... |
Arguments passed to |
Value
invisible(path)
.
See Also
Other functions to import files into an environment:
load_any()
Other functions to import files of common formats:
list_csv()
Examples
(path_csv <- tor_example("csv"))
dir(path_csv)
load_csv(path_csv)
# Each file is now available in the global environment
csv1
csv2
(path_mixed <- tor_example("mixed"))
dir(path_mixed)
# Loading the data in an environment other than the global environment
e <- new.env()
load_rdata(path_mixed, envir = e)
# Each dataframe is now available in the environment `e`
e$lower_rdata
e$upper_rdata
[Package tor version 1.1.3 Index]