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

clone

Cloning ff and ram objects


Description

clone physically duplicates objects and can additionally change some features, e.g. length.

Usage

clone(x, ...)

## Default S3 method:
clone(x, ...)

Arguments

x

x an R object

...

further arguments to the generic

Details

clone is generic. clone.default handles ram objects. Further methods are provided in package 'ff'. still.identical returns TRUE if the two atomic arguments still point to the same memory.

Value

an object that is a deep copy of x

Methods (by class)

  • default: default method uses R's C-API 'duplicate()'

Author(s)

Jens Oehlschlägel

See Also

clone.ff, copy_vector

Examples

x <- 1:12
  y <- x
  still.identical(x,y)
  y[1] <- y[1]
  still.identical(x,y)
  y <- clone(x)
  still.identical(x,y)
  rm(x,y); gc()

bit

Classes and Methods for Fast Memory-Efficient Boolean Selections

v4.0.4
GPL-2 | GPL-3
Authors
Jens Oehlschlägel [aut, cre], Brian Ripley [ctb]
Initial release
2020-08-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.