MyNixOS website logo
Description

Matrices in Data Frames.

Provides functions to collapse a tidy data frame into matrices in a data frame and expand a data frame of matrices into a tidy data frame.

CRANstatus lifecycle Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped. R-CMD-check Codecov testcoverage DOI

matsindf

Statement of need

Matrices are important mathematical objects, and they often describe networks of flows among nodes. The power of matrices lies in their ability to organize network-wide calculations, thereby simplifying the work of analysts who study entire systems.

But wouldn’t it be nice if there were an easy way to create R data frames whose entries were not numbers but entire matrices? If that were possible, matrix algebra could be performed on columns of similar matrices.

That’s the reason for matsindf. It provides functions to convert a suitably-formatted tidy data frame into a data frame containing a column of matrices.

Furthermore, matsbyname is a sister package that

  • provides matrix algebra functions that respect names of matrix rows and columns (dimnames in R) to free the analyst from the task of aligning rows and columns of operands (matrices) passed to matrix algebra functions and
  • allows matrix algebra to be conducted within data frames using dplyr, tidyr, and other tidyverse functions.

When used together, matsindf and matsbyname allow analysts to wield simultaneously the power of both matrix mathematics and tidyverse functional programming.

Installation

You can install matsindf from CRAN with:

install.packages("matsindf")

You can install a recent development version of matsindf from github with:

# install devtools if not already installed
# install.packages("devtools")
devtools::install_github("MatthewHeun/matsindf")
# To build vignettes locally, use
devtools::install_github("MatthewHeun/matsindf", build_vignettes = TRUE)

History

The functions in this package were used in Heun et al. (2018).

More Information

Find more information, including vignettes and function documentation, at https://MatthewHeun.github.io/matsindf/.

References

Heun, Matthew Kuperus, Anne Owen, and Paul E. Brockway. 2018. “A Physical Supply-Use Table Framework for Energy Analysis on the Energy Conversion Chain.” Applied Energy 226 (September): 1134–62. https://doi.org/10.1016/j.apenergy.2018.05.109.

Metadata

Version

0.4.8

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows