Learn R Programming

rlist (version 0.4.6.1)

list.load: Load a list from file

Description

Load a list from file

Usage

list.load(file, type = tools::file_ext(file), ..., guess = c("json", "yaml",
  "rds", "rdata", "xml"), action = c("none", "merge", "ungroup"),
  progress = length(file) >= 5L)

Arguments

file

a character vector. The file as input.

type

The type of input which, by default, is determined by file extension. Currently supports RData, RDS, JSON, YAML.

...

Additional parameters passed to the loader function

guess

a character vector to guess iteratively if type of file is unrecognized, NA or empty string.

action

The post-processing action if multiple files are supplied. This parameter will be ignored if only a single file is supplied.

'none' (default) to leave the resulted list as a list of elements corresponding to elements in file vector.

'merge' to merge the list elements iteratively, the later lists always modify the former ones through modifyList.

'ungroup' to ungroup the list elements, especially when each file is a page of elements with identical structure.

progress

TRUE to show a text progress bar in console while loading files. By default, if file contains 5 elements, then the progress bar will automatically be triggered to indicate loading progress.

Examples

Run this code
# NOT RUN {
list.load('list.rds')
list.load('list.rdata')
list.load('list.yaml')
list.load('list.json')
# }

Run the code above in your browser using DataLab