clone
physically duplicates ff (and ram) objects and can additionally change some features, e.g. length.
# S3 method for ff
clone(x
, initdata = x
, length = NULL
, levels = NULL
, ordered = NULL
, dim = NULL
, dimorder = NULL
, bydim = NULL
, symmetric = NULL
, fixdiag = NULL
, names = NULL
, dimnames = NULL
, ramclass = NULL
, ramattribs = NULL
, vmode = NULL
, update = NULL
, pattern = NULL
, filename = NULL
, overwrite = FALSE
, pagesize = NULL
, caching = NULL
, finalizer = NULL
, finonexit = NULL
, FF_RETURN = NULL
, BATCHSIZE = .Machine$integer.max
, BATCHBYTES = getOption("ffbatchbytes")
, VERBOSE = FALSE
, …)
x
scalar or vector of the .vimplemented
vmode
s, recycled if needed, default 0, see also as.vmode
and vector.vmode
optional character vector of levels if (in this case initdata must be composed of these) (default: derive from initdata)
indicate whether the levels are ordered (TRUE) or non-ordered factor (FALSE, default)
dimorder by which to interpret the 'initdata', generalization of the 'byrow' paramter in matrix
extended feature: TRUE creates symmetric matrix (default FALSE)
extended feature: non-NULL scalar requires fixed diagonal for symmetric matrix (default NULL is free diagonal)
see names
NOT taken from initdata, see dimnames
class attribute attached when moving all or parts of this ff into ram, see ramclass
additional attributes attached when moving all or parts of this ff into ram, see ramattribs
set to FALSE to avoid updating with 'initdata' (default TRUE) (used by ffdf
)
root pattern for automatic ff filename creation (default "ff"), see also physical
set to TRUE to allow overwriting existing files (default FALSE)
pagesize in bytes for the memory mapping (default from getOptions("ffpagesize") initialized by getdefaultpagesize
), see also physical
caching scheme for the backend, currently 'mmnoflush' or 'mmeachflush' (flush mmpages at each swap, default from getOptions("ffcaching") initialized with 'memorymap'), see also physical
name of finalizer function called when ff object is removed
, (default "deleteIfOpen" from getOptions("fffinalizer"))), standard finalizers are close.ff
, delete.ff
and deleteIfOpen.ff
, see also reg.finalizer
logical scalar determining whether finalizer is also called when R is closed via q
, (default TRUE from getOptions("fffinonexit"))
logical scalar or ff object to be used. The default NULL creates a ff or ram clone, TRUE returns a ff clone, FALSE returns a ram clone. Handing over an ff object here uses this or stops if not ffsuitable
integer scalar limiting the number of elements to be processed in update.ff
when length(initdata)>1, default from getOption("ffbatchsize")
set to TRUE for verbosing in update.ff
when length(initdata)>1, default FALSE
further arguments to the generic
an ff or ram object
clone
is generic. clone.ff
is the workhorse behind as.ram
and as.ff
.
For creating the desired object it calls ff
which calls update
for initialization.
# NOT RUN {
x <- ff(letters, levels=letters)
y <- clone(x, length=52)
rm(x,y); gc()
# }
Run the code above in your browser using DataLab