Learn R Programming

qol (version 1.2.1)

libname: Check If Path Exists And Retrieve Files

Description

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)

Value

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

Arguments

path

A folder path.

get_files

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

Examples

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

Run the code above in your browser using DataLab