Get ramclass and ramattribs
ramattribs.rdFunctions ramclass and ramattribs return the respective virtual attributes, that determine which class (and attributes) an ff object receives when subscripted (or coerced) to ram.
Usage
ramclass(x, ...)
# S3 method for class 'ff'
ramclass(x, ...)
# Default S3 method
ramclass(x, ...)
ramattribs(x, ...)
# S3 method for class 'ff'
ramattribs(x, ...)
# Default S3 method
ramattribs(x, ...)Details
ramclass and ramattribs provide a general mechanism to store atomic classes in ff objects,
for example factor – see levels.ff – and POSIXct, see the example.
Value
ramclass returns a character vector with classnames and ramattribs returns a list with names elemens just like attributes.
The vectors ramclass_excludes and ramattribs_excludes name those attributes, which are not exported from ff to ram objects when using as.ram.
Examples
x <- ff(as.POSIXct(as.POSIXlt(Sys.time(), "GMT")), length=12)
x
#> ff (open) double length=12 (12)
#> [1] [2]
#> 2026-08-03 14:06:09.524621 2026-08-03 14:06:09.524621
#> [3] [4]
#> 2026-08-03 14:06:09.524621 2026-08-03 14:06:09.524621
#> [5] [6]
#> 2026-08-03 14:06:09.524621 2026-08-03 14:06:09.524621
#> [7]
#> : 2026-08-03 14:06:09.524621
#> [8] [9]
#> 2026-08-03 14:06:09.524621 2026-08-03 14:06:09.524621
#> [10] [11]
#> 2026-08-03 14:06:09.524621 2026-08-03 14:06:09.524621
#> [12]
#> 2026-08-03 14:06:09.524621
ramclass(x)
#> [1] "POSIXct" "POSIXt"
ramattribs(x)
#> $tzone
#> [1] "GMT"
#>
class(x[])
#> [1] "POSIXct" "POSIXt"
attributes(x[])
#> $tzone
#> [1] "GMT"
#>
#> $class
#> [1] "POSIXct" "POSIXt"
#>
virtual(x)$ramattribs$tzone = NULL
attributes(x[])
#> $class
#> [1] "POSIXct" "POSIXt"
#>
rm(x); gc()
#> used (Mb) gc trigger (Mb) max used (Mb)
#> Ncells 1252708 67.0 2239654 119.7 2239654 119.7
#> Vcells 2307393 17.7 8388608 64.0 8387257 64.0