duplicateObject: Duplicate an R object

Description Usage Arguments Value Examples

View source: R/altWrapper-tools.R

Description

Duplicate an R object, the argument shallow controls whether to duplicate the container only or the entire object. It can be useful in defining the duplication function of an ALTREP. Please note that the function does not work with an enviroment object. It will return the same enviroment object.

Usage

1
duplicateObject(x, shallow = FALSE)

Arguments

x

The object that will be duplicated. The object should not be an enviroment object.

shallow

Logical, shallow duplicate or not

Value

An object of the same type as the input

Examples

1
2
3
4
a <- 10
b <- duplicateObject(a)
.Internal(inspect(a))
.Internal(inspect(b))

Jiefei-Wang/AltWrapper documentation built on Oct. 30, 2019, 7:43 p.m.