fatdiag: Fat Matrix Diagonals

Description Usage Arguments Details Functions Examples

View source: R/fatdiag.R

Description

Fat Matrix Diagonals

Usage

1
2
3
fatdiag(x = 1, steps = NULL, size = NULL, nrow = NULL, ncol = NULL)

fatdiag(x, steps = NULL, size = NULL, on_diagonal = TRUE) <- value

Arguments

x

a matrix where the dimensions are integer multiples of size or integer dividors of steps

steps

the required number of steps (block matrices) across the diagonal

size

the width or height of the matrix being dropped over the diagonal of matrix x

nrow

the number of rows

ncol

the number of columns

on_diagonal

should the operation be apply to the elements on the fat diagonal.

value

replacement value

Details

Either steps or size is expected to be provided.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
fatdiag(12, steps=3)

( m <- matrix(111, nrow=6, ncol=9) )
fatdiag(m, steps=3) <- 5

fatdiag(m, steps=3)

fatdiag(12, size=4)

fatdiag(12, size=c(3,4) )

bquast/diagonals documentation built on May 11, 2017, 3:32 p.m.