Learn R Programming

ff (version 4.0.4)

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 ffdf
physical(x)
# S3 method for ffdf
virtual(x)

Arguments

x

an ffdf object

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)

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.

See Also

ffdf, physical, virtual, vmode

Examples

Run this code
# NOT RUN {
  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()
# }

Run the code above in your browser using DataLab