Convert a set of values from a Simile model component from a nested list of alternating indices and values to an R array structure
tcl.paired.to.array(paired, dims, as.enum.types)
paired |
Nested list of alternating indices and values |
dims |
Dimensions of R array structure |
as.enum.types |
If TRUE, values will be converted to R character strings, otherwise they are numeric |
A numerical value or array of numerical values, from the Tcl value or array
Note that the dimensions of the array returned will be in the opposite order from those supplied in the 'dims' argument. This is because Simile's convention is to list the outermost dimension first, whereas R's is to list the outermost dimension last.
Jasper Taylor
Simile:::tcl.paired.to.array("1 {1 7 2 4} 2 {1 8 2 6} 3 {1 9 2 1}",
c(3,2), FALSE)
# [,1] [,2] [,3]
#[1,] 7 8 9
#[2,] 4 6 1