LinkedMatrix v1.4.0

0

Monthly downloads

0th

Percentile

Column-Linked and Row-Linked Matrices

A class that links matrix-like objects (nodes) by rows or by columns while behaving similarly to a base R matrix. Very large matrices are supported if the nodes are file-backed matrices.

Readme

LinkedMatrix

CRAN_Status_Badge Rdoc Travis-CI Build Status AppVeyor Build Status Coverage status

LinkedMatrix is an R package that provides matrices implemented as lists of matrix-like nodes, linked by columns or rows.

It was originally developed for the BGData package to address the array size limit of ff (length must be between 1 and .Machine$integer.max) by chaining multiple ff objects together.

This package is deliberately kept simple. For computational methods that use LinkedMatrix check out the BGData package.

Example

The following code generates three different matrix-like objects and links them together by rows in a RowLinkedMatrix. The LinkedMatrix instance can then be treated like any other regular matrix.

library(LinkedMatrix)

m1 <- ff::ff(initdata = rnorm(50), dim = c(5, 10))
m2 <- bigmemory::big.matrix(init = rnorm(50), nrow = 5, ncol = 10)
m3 <- matrix(data = rnorm(50), nrow = 5, ncol = 10)
m <- RowLinkedMatrix(m1, m2, m3)

dim(m)
m[1, ]
m[, 1]

Installation

Install the stable version from CRAN:

install.packages("LinkedMatrix")

Alternatively, install the development version from GitHub:

# install.packages("remotes")
remotes::install_github("QuantGen/LinkedMatrix")

Documentation

Further documentation can be found on RDocumentation.

Contributing

Functions in LinkedMatrix

Name Description
as.ColumnLinkedMatrix Converts an Object to a LinkedMatrix Object
nodes Returns the Column or Row Indexes at Which Each Node Starts and Ends
ColumnLinkedMatrix Create a LinkedMatrix Object
cbind.ColumnLinkedMatrix Combine Matrix-Like Objects by Columns or Rows
ColumnLinkedMatrix-class A Class for Linking Matrices by Columns or Rows
LinkedMatrix Create an Empty, Prespecified LinkedMatrix Object
index Maps Each Column or Row Index of a Linked Matrix to the Column or Row Index of Its Corresponding Node
as.matrix.LinkedMatrix Converts a LinkedMatrix Instance to a Matrix (if Small Enough)
LinkedMatrix-package LinkedMatrix
LinkedMatrix-class A Class Union of ColumnLinkedMatrix and RowLinkedMatrix
nNodes Returns the Number of Nodes
No Results!

Last month downloads

Details

License MIT + file LICENSE
URL https://github.com/QuantGen/LinkedMatrix
BugReports https://github.com/QuantGen/LinkedMatrix/issues
Collate 'ColumnLinkedMatrix.R' 'RowLinkedMatrix.R' 'LinkedMatrix.R' 'utils.R'
NeedsCompilation no
Packaged 2020-05-21 21:53:06 UTC; agrueneberg
Repository CRAN
Date/Publication 2020-05-22 10:20:02 UTC

Include our badge in your README

[![Rdoc](http://www.rdocumentation.org/badges/version/LinkedMatrix)](http://www.rdocumentation.org/packages/LinkedMatrix)