prv.big.matrix: Tidier display function for big matrix objects

Description Usage Arguments Value See Also Examples

View source: R/bigpca.R

Description

This function prints the first and last columns and rows of a big matrix, and a few more than this if desired. Allows previewing of a big.matrix without overloading the console.

Usage

1
2
3
prv.big.matrix(bigMat, dir = "", rows = 3, cols = 2, name = NULL,
  dat = TRUE, descr = NULL, bck = NULL, mem = FALSE, rcap = "",
  ccap = "", ...)

Arguments

bigMat

the description file, big.matrix object, or big.matrix.descriptor object, anything that can be read by get.big.matrix()

dir

the directory containing the big.matrix backing/description files

rows

integer, number of rows to display

cols

integer, number of columns to display

name

logical, whether to print a name for the matrix

dat

logical, whether to print any of the matrix contents (overrides row/col)

descr

character, optional name of the description file, which if not null will be displayed

bck

character, optional name of the backing file, which if not null will be displayed

mem

logical, whether to display the amount of memory used by the object

rcap

character, caption to display for the rows

ccap

character, caption to display for the columns

...

additional arguments to prv.large (from NCmisc) which displays the end result

Value

Prints to console a compact representation of the bigMat matrix, with the first few rows and columns, and the last row and column. Note that sometimes the initial printing of a big.matrix can take a little while. But subsequently the printout should be almost instantaneous.

See Also

get.big.matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
orig.dir <- getwd(); setwd(tempdir()); # move to temporary dir
if(file.exists("test.bck")) { unlink(c("test.bck","test.dsc")) }
bM <- filebacked.big.matrix(20, 50,
       dimnames = list(paste("r",1:20,sep=""), paste("c",1:50,sep="")),
       backingfile = "test.bck",  backingpath = getwd(), descriptorfile = "test.dsc")
bM[1:20,] <- replicate(50,rnorm(20))
prv.big.matrix(bM)
prv.big.matrix(bM,rows=10,cols=4)
rm(bM) 
unlink(c("test.dsc","test.bck"))  # clean up files
setwd(orig.dir)

bigpca documentation built on Nov. 22, 2017, 1:02 a.m.