Re-format model value array

Share:

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

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

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

Value

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

Author(s)

Jasper Taylor

See Also

tcl.paired.to.array

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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