resizeBM: Resizes a "big.matrix" in place

Description Usage Arguments Details Value See Also Examples

Description

This is needed to change the size of a big.matrix without the need to create a separate object. Warning, this completely overwrites the initial structure and requires reshaping again if you wish to access the original structure again.

Usage

1
  resizeBM(x, nRows = 0, nCols = 0)

Arguments

x

a big.matrix.

nRows

number of rows to increment(+) or decrement(-)

nCols

number of columns to increment(+) or decrement(-)

Details

This is needed to resize a big.matrix, because traditional R syntax would only require a new independent pointer. This allows for in-place reshaping.

Value

a The original big.matrix is returned with reshaped dimensions.

See Also

big.matrix

Examples

1
2
3
4
5
6
7
  
  x <- as.big.matrix(matrix(1:12, 3, 4))
  x@address
  resize(x, 1, -1)    # Increase row length by 1, decrease col length by 1
  x@address   # address the same as initial
  head(x)
  

cdeterman/bigmemory2 documentation built on May 13, 2019, 2:36 p.m.