tor (version 1.1.2)

list_csv: Import multiple common files from a directory into a list.

Description

These functions wrap common use-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 path. Defaults to the working directory.

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 functions to import files into a list: list_any()

Other functions to import files of common formats: 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