list.load: Load a list from file

Description Usage Arguments Examples

View source: R/list.load.R

Description

Load a list from file

Usage

1
2
3
4
5
6
7
8
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

1
2
3
4
5
6
7
## Not run: 
list.load('list.rds')
list.load('list.rdata')
list.load('list.yaml')
list.load('list.json')

## End(Not run)

rlist documentation built on Sept. 5, 2021, 5:30 p.m.