varname: Add Internal Name to Vector

Description Usage Arguments Value Examples

View source: R/varname.R

Description

Adds the class variable and an internal attributes(x)[["varname"]] attribute to a vector.

Usage

1

Arguments

x

A vector to add a varname attribute (i.e., attributes(x)[["varname"]])

name

A name to assign to attributes(x)[["varname"]].

Value

Returns a vector of the class variable with a attributes(x)[["varname"]] assigned.

Examples

1
2
3
4
5
6
7
varname(1:10, "A")
attributes(varname(1:10, "A"))
sum(varname(1:10, "A"))

varname(LETTERS, "Caps")
attributes(varname(LETTERS, "Caps"))
paste(varname(LETTERS, "Caps"), collapse="")

trinker/wakefield documentation built on Aug. 18, 2018, 6:28 p.m.