f: List files and directories in current directory.

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/f.R

Description

List files and directories in current directory in matrix format. Each row is preceded by a row number.

Usage

1
2
f(path = ".", pattern = NULL, all.files = FALSE, 
full.names = FALSE, recursive = FALSE, ignore.case = FALSE)

Arguments

path

A character vector of full path names; the default corresponds to the working directory getwd(). Missing values will be ignored.

pattern

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

all.files

Logical. If FALSE, only the names of visible files are returned. If TRUE, all file names will be returned.

full.names

Logical. If TRUE, the directory path is prepended to the file names. If FALSE, only the file names are returned.

recursive

Logical. Should the listing recurse into directories?

ignore.case

Logical. Should pattern-matching be case-insensitive?

Value

A matrix containing the names of the files and directories, preceded by a row number, in the specified directories. If a path does not exist or is not a directory or is unreadable it is skipped, with a warning.

The files are sorted in alphabetical order, on the full path if full.names = TRUE. Directories are included only if recursive = FALSE.

Note

File naming conventions are platform dependent. recursive = TRUE is not supported on all platforms and may be ignored (with a warning).

Author(s)

Antoine Tremblay, Statistics Canada, trea26@gmail.com

See Also

list.files

Examples

1
f()

LMERConvenienceFunctions documentation built on Oct. 23, 2020, 5:12 p.m.