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.
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, ...)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.
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.
x <- ff(as.POSIXct(as.POSIXlt(Sys.time(), "GMT")), length=12)
x
#> ff (open) double length=12 (12)
#> [1] [2] [3]
#> 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404
#> [4] [5] [6]
#> 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404
#> [7] [8]
#> : 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404
#> [9] [10] [11]
#> 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404 2025-03-17 22:35:54.24404
#> [12]
#> 2025-03-17 22:35:54.24404
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 1162681 62.1 1994352 106.6 1994352 106.6
#> Vcells 2167203 16.6 8790397 67.1 8790397 67.1