files_to_list: convert a vector of file paths into a named list

View source: R/io.R

files_to_listR Documentation

convert a vector of file paths into a named list

Description

convert a vector of file paths into a named list

Usage

files_to_list(files, label_index = -1)

Arguments

files

Vector of file paths (eg., by using "list_files()")

label_index

Which item in the path to return? 1-indexing. If <1, samples selected from the end.

Value

list of files

Examples

 files = c('/path/to/project/Sample1/table.txt', '/path/to/project/Sample2/table.txt')
 files_to_list(files, -1)
 files = c('/path/to/project/Sample1.txt', '/path/to/project/Sample2.txt')
 files_to_list(files, 0)

leylabmpi/LeyLabRMisc documentation built on Nov. 3, 2022, 3:45 p.m.