Learn R Programming

bigmemoryExtras (version 1.18.1)

BigMatrixFactor: Create a new BigMatrixFactor

Description

Create a new BigMatrixFactor

Usage

BigMatrixFactor(x = NA_character_, backingfile, nrow, ncol, dimnames = NULL, levels)

Arguments

x
scalar or matrix to be treated as character.
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
levels
character, as for a typical factor

Value

BigMatrixFactor

Examples

Run this code
dnames = dimnames=list(letters[1:3],LETTERS[1:3])
levels=c("AA","AB","BB")
x = matrix( sample( levels, 9, replace=TRUE), ncol=3, dimnames=dnames)
ds = BigMatrixFactor(x,tempfile(),levels=levels)
ds = BigMatrixFactor(backingfile=tempfile(),nrow=3,ncol=3,dimnames=dnames,levels=levels)

Run the code above in your browser using DataLab