Block Diagonal Extraction or Replacement

Several tools for handling block-matrix diagonals and similar constructs are implemented. Block-diagonal matrices can be extracted or removed using two small functions implemented here. In addition, non-square matrices are supported. Block diagonal matrices occur when two dimensions of a data set are combined along one edge of a matrix. For example, trade-flow data in the 'decompr' and 'gvc' packages have each country-industry combination occur along both edges of the matrix.


diagonals

CRAN Version RStudio Cloud Downloads Travis-CI Build Status Coverage Status

Block-diagonal matrices can be extracted or removed using two small functions implemented here, in addition, non-square matrices are supported.

Block diagonal matrices occur when we combine two dimensions of a data set along one edge of a matrix. For example, trade-flow data in the decompr and gvc package have each country-industry combination occur on each edge of the matrix.

Installation

The stable version of the diagonals package can be install from CRAN using:

install.packages("diagonals")

The development version, to be used at your peril, can be installed using:

if (!require('devtools')) install.packages('devtools')
devtools::install_github("bquast/diagonals")

Usage

Following installation, the package can be loaded using:

library(diagonals)

For general information on using the package, please refer to the help files .

help("diagonals")
help(package = "diagonals")

For examples of usage, see the function specific help page.

help("fatdiag")

In addition to the help files we provide long form examples in the vignettes .

vignette("fatdiag")
browseVignettes("diagonals")

Additional Information

An overview of the changes is available in the NEWS file.

news(package="diagonals")

There is also a blog post with information on my personal website.

http://qua.st/diagonals/

Development

Development takes place on the GitHub page.

https://github.com/bquast/diagonals

Bugs can be filed on the issues page on GitHub.

https://github.com/bquast/diagonals/issues

News

diagonals 0.4.0

  • various small fixes

diagonals 0.3.0

  • replace all previous functions with fatdiag

  • add fatdig <- function

diagonals 0.2.0

  • add support for replacement other than 0 (zero)

  • break out rectangles to separate functions: rectangle_matrix() and minus_rectangle_matrix()

diagonals 0.1.0

  • block_matrix(): for extracting block diagonals

  • minus_block_matrix(): for dropping block diagonals

  • add support for non-square matrices

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("diagonals")

0.4.0 by Bastiaan Quast, 3 years ago


http://qua.st/diagonals, https://github.com/bquast/diagonals


Report a bug at https://github.com/bquast/diagonals/issues


Browse source code at https://github.com/cran/diagonals


Authors: Bastiaan Quast [aut, cre]


Documentation:   PDF Manual  


GPL-3 license


Suggests testthat, knitr


Imported by gvc.


See at CRAN