comb2matrices: Combining two matrices

View source: R/Edge_Scenarios.R

comb2matricesR Documentation

Combining two matrices

Description

Combining two matrices. The parametric schem of matrice is defined by nattural numbers; different numbers = different rate parameters

Usage

comb2matrices(
  M1,
  M2,
  controlling.state = NULL,
  name.sep = "",
  diag.as = "",
  non.rate.as = NULL
)

Arguments

M1

matrix; if dependency true thenM1 controls M2

M2

matrix; if dependency true then: M2 depends on those states of M1 specified in controlling.state

controlling.state

state(s) of M1 that switches on/off matrix M2

name.sep

separator for state names

diag.as

hpopulate main diagonal with

Value

Matrix

Examples

M1 <- matrix(c(-1, 1, 2, -2), 2, 2, byrow = TRUE)
rownames(M1) <- colnames(M1) <- c("0", "1")
M2 <- matrix(c(-3, 3, 4, -4), 2, 2, byrow = TRUE)
rownames(M2) <- colnames(M2) <- c("0", "1")
comb2matrices(M1, M2, controlling.state = NULL)
comb2matrices(M1, M2, controlling.state = 2)

sergeitarasov/PhenoTraits documentation built on Jan. 31, 2025, 10:28 a.m.