read.directory: Bulk import data files

Description Usage Arguments Author(s) References

View source: R/read.directory.R

Description

Read in each file at a path and then unnest them. Defaults to csv format.

Usage

1
2
3
4
5
6
7
8
read.directory(
  path = ".",
  pattern = NULL,
  reader = utils::read.csv,
  ...,
  reducer = NULL,
  recursive = FALSE
)

Arguments

path

a character vector of full path names

pattern

an optional regular expression. Only file names which match the regular expression will be returned.

reader

a function that can read data from a file name.

...

optional arguments to pass to the reader function (eg stringsAsFactors).

reducer

a function to unnest the individual data files. Use I to retain the nested structure.

recursive

logical. Should the listing recurse into directories?

Author(s)

Neal Fultz

References

https://stackoverflow.com/questions/11433432/how-to-import-multiple-csv-files-at-once


nfultz/stackoverflow documentation built on Aug. 4, 2020, 5:31 a.m.