tor (version 1.0.1)

list_csv: Read multiple files from a directory into a list.

Description

These functions wrap the most common special cases of list_any().

Usage

list_csv(path = ".", regexp = "[.]csv$", ignore.case = TRUE,
  invert = FALSE, ...)

list_tsv(path = ".", regexp = "[.]tsv$", ignore.case = TRUE, invert = FALSE, ...)

list_rds(path = ".", regexp = "[.]rds$", ignore.case = TRUE, invert = FALSE)

list_rdata(path = ".", regexp = "[.]rdata$|[.]rda$", ignore.case = TRUE, invert = FALSE)

Arguments

path

A character vector of one or more paths.

regexp

A regular expression (e.g. [.]csv$) passed on to grep() to filter paths.

ignore.case

if FALSE, the pattern matching is case sensitive and if TRUE, case is ignored during matching.

invert

If TRUE return files which do not match

...

Arguments passed to readr::read_csv() or readr::read_tsv().

Value

A list.

See Also

Other general functions to import data: list_any, load_csv

Examples

Run this code
# NOT RUN {
(rds <- tor_example("rds"))
dir(rds)

list_rds(rds)

(tsv <- tor_example("tsv"))
dir(tsv)

list_tsv(tsv)

(mixed <- tor_example("mixed"))
dir(mixed)

list_rdata(mixed)

list_csv(mixed)

list_rdata(mixed, regexp = "[.]RData", ignore.case = FALSE)
# }

Run the code above in your browser using DataLab