BigMatrix: Create a new BigMatrix

Description Usage Arguments Value Examples

View source: R/BigMatrix.R

Description

Create a new BigMatrix

Usage

1
2
  BigMatrix(x = NA_real_, backingfile, nrow, ncol,
    dimnames = NULL, type = "double")

Arguments

x

scalar numeric, NULL, matrix, or big.matrix. Optional data or big.matrix for new BigMatrix. A scalar numeric can be used to initalize the whole matrix. NULL gives the bigmemory feature of initializing to all zeros instantly.

backingfile

character, full path to the file that will contain the data matrix

nrow

integer, number of rows in the matrix we are about to create

ncol

integer, number of columns in the matrix we are about to create

dimnames

list, list(rownames,colnames), as for a typical matrix

type

character type of big.matrix (double, integer, char)

Value

BigMatrix

Examples

1
2
3
4
dnames = dimnames=list(letters[1:3],LETTERS[1:3])
x = matrix(1:9,ncol=3,dimnames=dnames)
ds = BigMatrix(x,tempfile())
ds = BigMatrix(backingfile=tempfile(),nrow=3,ncol=3,dimnames=dnames)

bigmemoryExtras documentation built on Nov. 8, 2020, 5:17 p.m.