Skip to contents

libname() checks if a given path exists and writes a message in the console accordingly. Optional all files from the given path can be retrieved as a named character vector.

Usage

libname(path, get_files = FALSE, extensions = NULL, recursive = FALSE)

Arguments

path

A folder path.

get_files

FALSE by default. If TRUE returns a named character vector containing file paths.

extensions

Specify file extensions to be kept in the list when retrieving files.

recursive

FALSE by default. If TRUE scans the provided folder for additional files inside sub folders. Only work in combination with get_files = TRUE.

Value

Returns the given file path or a named character vector containing file paths.

Examples

my_path   <- libname("C:/My_Path/")
file_list <- libname("C:/My_Path/", get_files = TRUE)