copyAllNewAttributes: A simple thing to keep the attributes

Description Usage Arguments Value Examples

Description

Skips the attributes that the to object already has to avoid overwriting dim and other important attributes

Usage

1
copyAllNewAttributes(from, to, attr2skip = c(), attr2force = c())

Arguments

from

The from object

to

The to object

attr2skip

An optional lists of attributes that you may want to avoid having copied

attr2force

An optional lists of attributes that you may want to force copy even if they already exist in the new object

Value

object The to argument object

Examples

1
2
3
4
5
a <- "test"
attr(a, 'wow') <- 1000
b <- a
b <- copyAllNewAttributes(a, b)
print(attr(b, 'wow'))


Search within the Gmisc package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.