Copy specified attributes from a reference object to a target object.
Usage
copy_attr(target, ref, which = NULL)
Arguments
- target
An object to which attributes will be added.
- ref
A reference object from which attributes will be copied.
- which
A character vector specifying the names of attributes to copy. If NULL, all the attributes will be overwritten.
Value
The modified `target` object with selected attributes copied from `ref`.