files2list | R Documentation |
These functions load multiple data files from a specified directory and save them into one list.
rda2list()
loads multiple .rda files
dat2list()
loads multiple .dat files
csv2list()
loads multiple .csv files
rda2list(.path = ".", .file_pattern = ".rda$", .recursive = FALSE)
dat2list(
.path = ".",
.file_pattern = ".dat$",
.recursive = FALSE,
.sep = ";",
.dec = ".",
.header = TRUE
)
csv2list(
.path = ".",
.file_pattern = ".csv$",
.recursive = FALSE,
.sep = ";",
.dec = ".",
.header = TRUE
)
.path |
A string indicating the path of the directory that contains the files to be loaded. The default is the current working directory. |
.file_pattern |
A regular expression to return the files that this regular expression matches.
|
.recursive |
A logical indicating whether to recurse into directories. The default is FALSE. |
.sep |
The field separator character. The default is a semicolon. |
.dec |
The decimal point character used in the files. The default is a point. |
.header |
A logical indicating whether the files have a column header. |
A list that contains the files in .path
matching
the expression specified in .file_pattern
.
See also utils::read.table()
.
# load all .rda files in the current working directory into one list
rda2list()
# load all .dat files in the current working directory into one list
dat2list()
# load all .csv files in the current working directory into one list
csv2list()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.