listToRCode: Translates a nested list (as provided by a yaml file) into R...

Description Usage Arguments Value Note Examples

View source: R/package_maintenance.R

Description

Translates a nested list (as provided by a yaml file) into R code defining the lists

Usage

1
listToRCode(obj, indent = "    ", indentShift = "")

Arguments

obj

list; Nested list to be translated. The allowed list elements are: list, character, numeric, logical

indent

character (optional) (default: ' '[4 whitespaces]); Character(s) used for the indentation. Default: <tab>

indentShift

character (optional) (default: ”); Shifts the block to the right by putting the characters before each line (mostly used in internal recursion)

Value

character; R code for generating the nested list

Note

only for package maintenance!

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
test = list(bla='some text',blubb=list(a='more text', version='2.0'),justANumber=123456)
#$bla
#[1] "some text"
#$blubb
#$blubb$a
#[1] "more text"
#$blubb$version
#[1] "2.0"
#$justANumber
#[1] 123456
#
#listToRCode(test)
#[1] "list(\n\tbla=\"some text\",\n\tblubb=list(\n\t\ta=\"more text\",\n\t\tversion=\"2.0\"\n\t)\n)"

ndexr documentation built on March 13, 2021, 2 a.m.