Learn R Programming

Simile (version 1.3.4)

tcl.paired.to.list: Re-format model value array

Description

Convert a set of values from a Simile model component from a nested list of alternating indices and values to an R nested list structure

Usage


tcl.paired.to.list(paired, as.enum.types)

Value

A numerical value or nested list of numerical values, from the Tcl value or array

Arguments

paired

Nested list of alternating indices and values

as.enum.types

If TRUE, indices and values will be converted to R character strings, otherwise they are numeric

Author

Jasper Taylor

See Also

tcl.paired.to.array

Examples

Run this code
Simile:::tcl.paired.to.list("1 {1 7 2 4} 2 {1 8} 3 {2 1}", FALSE)
# [[1]]
# [[1]][[1]]
# [1] 7
# 
# [[1]][[2]]
# [1] 4
# 
# 
# [[2]]
# [[2]][[1]]
# [1] 8
# 
# 
# [[3]]
# [[3]][[1]]
# NULL
# 
# [[3]][[2]]
# [1] 1

Run the code above in your browser using DataLab