list_any {tor} | R Documentation |
Import multiple files of any format from a directory into a list.
Description
Import multiple files of any format from a directory into a list.
Usage
list_any(
path = ".",
.f,
regexp = NULL,
ignore.case = FALSE,
invert = FALSE,
...
)
Arguments
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 |
... |
Additional arguments passed to |
Value
A list.
See Also
Other functions to import files into a list:
list_csv()
Other functions to import files of any format:
load_any()
Examples
tor_example()
(path <- tor_example("csv"))
dir(path)
list_any(path, read.csv)
list_any(path, ~ read.csv(.x, stringsAsFactors = FALSE))
(path_mixed <- tor_example("mixed"))
dir(path_mixed)
list_any(
path_mixed, ~ get(load(.x)),
"[.]Rdata$",
ignore.case = TRUE
)
list_any(
path_mixed, ~ get(load(.x)),
regexp = "[.]csv$",
invert = TRUE
)
[Package tor version 1.1.3 Index]