list_files: List files

Description Usage Arguments Value See Also Examples

Description

Returns names of files located in a given directory. It's similar to list.files() only with better defaults and behaviors.

Usage

1
2
list_files(path = ".", full = TRUE, all = FALSE, recursive = FALSE,
  pattern = NULL, ignore.case = FALSE, invert = FALSE)

Arguments

path

Directory from which to locate dirs–defaults to current working directory.

full

Logical indicating whether to return full paths. Defaults to TRUE.

all

Logical indicating whether to return all (include dot files) file names. Defaults to FALSE.

recursive

Logical indicating whether to recursively list files.

pattern

Regular expression pattern on which to filter (return) matching results. Defaults to NULL, meaning all qualifying files will be returned.

ignore.case

Logical indicating whether to ignore case if pattern is supplied–defaults to FALSE.

invert

Logical indicating whether to invert (return those that DO NOT match) regex matching results–defaults to FALSE.

Value

A character vector of directories

See Also

Other list_paths: list_dirs, list_paths

Examples

1
2
## list files in working directory
list_files()

mkearney/fml documentation built on May 9, 2019, 10:43 a.m.