Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vw

Getting and setting virtual windows


Description

The virtual window vw function allows one to define a virtual window into an ff_vector or ff_array. The ff object will behave like a smaller array and it is mapped into the specified region of the complete array. This allows for example to execute recursive divide and conquer algorithms that work on parts of the full object, without the need to repeatedly create subfiles.

Usage

vw(x, ...)
vw(x, ...) <- value
## S3 method for class 'ff'
vw(x, ...)
## Default S3 method:
vw(x, ...)
## S3 replacement method for class 'ff_vector'
vw(x, ...) <- value
## S3 replacement method for class 'ff_array'
vw(x, ...) <- value

Arguments

x

an ff_vector or ff_array

...

further arguments (not used)

value

a vector or matrix with an Offset, Window and Rest component, see details and examples

Details

Each dimension of an ff array (or vector) is decomposed into three components, an invisible Offset, a visibe Window and an invisible Rest. For each dimension the sum of the vw components must match the dimension (or length). For an ff_vector, vw is simply a vector[1:3], for an array is is a matrix[1:3,seq_along(dim(x))]. vw is a virtual attribute.

Value

NULL or a vw specification, see details

Author(s)

Jens Oehlschlägel

See Also

Examples

x <- ff(1:26, names=letters)
  y <- x
  vw(x) <- c(0, 13, 13)
  vw(y) <- c(13, 13, 0)
  x
  y
  x[1] <- -1
  y[1] <- -2
  vw(x) <- NULL
  x[]

  z <- ff(1:24, dim=c(4,6), dimnames=list(letters[1:4], LETTERS[1:6]))
  z
  vw(z) <- rbind(c(1,1), c(2,4), c(1,1))
  z

  rm(x,y,z); gc()

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.