extract_replacemethod: "[<-" S3 Replacement method for 'blockmatrix' object

Description Usage Arguments Value Note Author(s) Examples

Description

'[<-' S3 Replacement method for blockmatrix object

Usage

1
2
  ## S3 replacement method for class 'blockmatrix'
 M[i = 1:nrow(M), j = 1:ncol(M)] <- value

Arguments

M

a blockmatrix object

i,j

matrix indices (numerical or character)

value

a blockmatrix object to be replaced

Value

The "replaced" blockmatrix object.

Note

In case i is a character vector, the elements whose names is in value is replaced.

Author(s)

Emanuele Cordano

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rm(list=ls())
library(blockmatrix)
A <- array(rnorm(9,mean=1),c(3,3))
B <- 0 #array(rnorm(9,mean=2),c(3,3))
C <- 0
D <- array(rnorm(9,mean=4),c(3,3))
F <- array(rnorm(9,mean=10),c(3,3))
M <- blockmatrix(names=c("A","0","D","0"),A=A,D=D,dim=c(2,2))
E <- blockmatrix(names=c("0","F","D","0"),F=F,D=D,dim=c(2,2))
E[,1] <- M[,1]

blockmatrix documentation built on May 2, 2019, 6:11 a.m.