file_index_create {fabR}R Documentation

Create an index of files in a folder

Description

Creates a tibble listing files in a specified folder (recursively) with file path name and other useful metadata. This index can be used to quickly find files in the environment. The index also generates script to read files as R objects into the environment. Names for R objects are generated automatically from file names (R objects are not created at this step but the command line is generated and stored in the column to_eval, ready to be evaluated and generate R objects).

Usage

file_index_create(folder = getwd(), pattern = "^", negate = FALSE)

Arguments

folder

A character string identifying the folder to index. If not specified, the current folder is the default

pattern

A character string defining a pattern to sub-select within folder. Can be useful for excluding certain folders from indexing (matching by regex is supported).

negate

logical. If TRUE, return non-matching elements.

Details

The user must make sure their files are in the folder to be indexed.

Value

A tibble with folder_path, file_path, file_name, extension, file_type columns and a last column to_eval which is R code in a character vector to read the file into the environment.

Examples

## Not run: 

file_index_create(tempdir())


## End(Not run)


[Package fabR version 2.1.0 Index]