R/load_any.R
load_any.Rd
Import multiple files of any format from a directory into an environment.
load_any( path = ".", .f, regexp = NULL, ignore.case = FALSE, invert = FALSE, envir = .GlobalEnv, ... )
path | A character vector of one path. Defaults to the working directory. |
---|---|
.f | A function able to read the desired file format. |
regexp | A regular expression (e.g. |
ignore.case | if |
invert | If |
envir | an |
... | Additional arguments passed to |
Other functions to import files into an environment:
load_csv()
Other functions to import files of any format:
list_any()
#> [1] "rdata1" "rdata2"# The data is now available in the environment `e` e$rdata1#> # A tibble: 2 × 1 #> x #> <dbl> #> 1 1 #> 2 2e$rdata2#> # A tibble: 2 × 1 #> y #> <chr> #> 1 a #> 2 b