Learn R Programming

vectools (version 0.2.0)

13_other_conversion_functions: Other Conversion Functions

Description

Functions to convert ObjectArrays to lists, and NestMatrix and SectMatrix objects to matrices.

Usage

# S3 method for ObjectArray
as.list(x, …)

# S3 method for NestMatrix as.matrix(x, …) # S3 method for SectMatrix as.matrix(x, …)

Arguments

x

An ObjectArray/NestMatrix or PartMatrix/SectMatrix object. Note that nested matrices need to be conformable and non-recursive.

Ignored.

Examples

Run this code
# NOT RUN {
x <- NestMatrix (2, 2)
x [[1, 1]] <- matrix ("AA", 2, 2)
x [[1, 2]] <- matrix ("AB", 2, 2)
x [[2, 1]] <- matrix ("BA", 2, 2)
x [[2, 2]] <- matrix ("BB", 2, 2)

x
as.matrix (x)
# }

Run the code above in your browser using DataLab