AssignAttr: AssignAttr

Description Usage Arguments Value Examples

View source: R/extra.R

Description

Applies arbitrary setter functions to an object within a local scope and returns the object with attributes set.

Usage

1
AssignAttr(x, attr, value)

Arguments

x

object

attr

name of attribute (character)

value

value of attribute

Value

The same object with attribute set to desired value.

Examples

1
2
3
4
5
a <- cbind(1:2)
colnames(a) <- "numbers"
print(a)

b <- AssignAttr(cbind(1:2), "colnames", "numbers")

stakahama/Rfunctools documentation built on June 8, 2021, 10:25 p.m.