modMATRIX: Create a matrix

View source: R/matrix.R

modMATRIXR Documentation

Create a matrix

Description

Create a matrix

Usage

modMATRIX(
  x,
  use = TRUE,
  block = FALSE,
  correlation = FALSE,
  digits = -1,
  context = "matlist",
  ...
)

Arguments

x

data for building the matrix. Data in x are assumed to be on-diagonal elements if block is FALSE and lower-triangular elements if block is TRUE

use

logical; if FALSE, all matrix elements are set to 0

block

logical; if TRUE, try to make a block matrix; diagonal otherwise

correlation

logical; if TRUE, off diagonal elements are assumed to be correlations and converted to covariances; if correlation is TRUE, then block is set to TRUE

digits

if value of this argument is greater than zero, the matrix is passed to signif (along with digits) prior to returning

context

the working context

...

passed along

Examples

modMATRIX("1 2.2 333")
modMATRIX("1 1.1 2.2", block=TRUE)
modMATRIX("23 234 234 5234", use=FALSE)

ans <- modMATRIX("1.1 0.657 2.2", correlation=TRUE, block=TRUE)
ans
cov2cor(ans)


mrgsolve documentation built on Oct. 18, 2024, 5:12 p.m.

Related to modMATRIX in mrgsolve...