You are here

tcl.paired.to.array: 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 array structure

Usage

tcl.paired.to.array(paired, dims, as.enum.types)

Arguments

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

Value

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

Note

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.

Author(s)

Jasper Taylor

See Also

tcl.paired.to.list

Examples

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