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

physical.ffdf

Getting physical and virtual attributes of ffdf objects


Description

Functions for getting physical and virtual attributes of ffdf objects.

Usage

## S3 method for class 'ffdf'
physical(x)
## S3 method for class 'ffdf'
virtual(x)

Arguments

x

an ffdf object

Details

ffdf objects enjoy a complete decoupling of virtual behaviour from physical storage. The physical component is simply a (potentially named) list where each element represents an atomic ff vector or matrix. The virtual component is itself a dataframe, each row of which defines a column of the ffdf through a mapping to the physical component.

Value

'physical.ffdf' returns a list with atomic ff objects.
'virtual.ffdf' returns a data.frame with the following columns

VirtualVmode

the vmode of this row (=ffdf column)

AsIs

logical defining the AsIs status of this row (=ffdf column)

VirtualIsMatrix

logical defining whether this row (=ffdf column) represents a matrix

PhysicalIsMatrix

logical reporting whether the corresponding physical element is a matrix

PhysicalElementNo

integer identifying the corresponding physical element

PhysicalFirstCol

integer identifying the first column of the corresponding physical element (1 if it is not a matrix)

PhysicalLastCol

integer identifying the last column of the corresponding physical element (1 if it is not a matrix)

Author(s)

Jens Oehlschlägel

See Also

Examples

x <- 1:2
  y <- matrix(1:4, 2, 2)
  z <- matrix(1:4, 2, 2)

  message("Here the y matrix is first converted to single columns by data.frame, 
then those columns become ff")
  d <- as.ffdf(data.frame(x=x, y=y, z=I(z)))
  physical(d)
  virtual(d)

  message("Here the y matrix is first converted to ff, and then stored still as matrix 
in the ffdf object (although virtually treated as columns of ffdf)")
  d <- ffdf(x=as.ff(x), y=as.ff(y), z=I(as.ff(z)))
  physical(d)
  virtual(d)

  message("Apply the usual methods extracting physical attributes")
  lapply(physical(d), filename)
  lapply(physical(d), vmode)
  message("And don't confuse with virtual vmode")
  vmode(d)

  rm(d); 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.