As_TsparseMatrix {SSBtools}R Documentation

Transform to TsparseMatrix/dgTMatrix

Description

To implement adaption needed after Matrix ver. 1.4-2 since as(from, "dgTMatrix") no longer allowed.

Usage

As_TsparseMatrix(from, do_drop0 = TRUE)

Arguments

from

A matrix

do_drop0

whether to run drop0

Details

This function is made to replace as(from, "dgTMatrix") and as(drop0(from), "dgTMatrix") in SSBtools and related packages.

Value

A matrix. Virtual class is TsparseMatrix. Class dgTMatrix expected.

Note

Matrix:::.as.via.virtual in development version of package Matrix (date 2022-08-13) used to generate code.


[Package SSBtools version 1.5.0 Index]