varname: Add Internal Name to Vector

Description Usage Arguments Value Examples

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="")

wakefield documentation built on Sept. 14, 2020, 1:07 a.m.