varnames: Object Attributes Varnames and Units

Description Usage Arguments Details Value

Description

varnames and units are useful attributes that can store original variable names (varnames) and units of measurement (units) of each column in a data frame or of an atomic type. These attributes can be extracted or assigned by following functions.

Usage

1
2
3
4
5
6
7
varnames(x, names = FALSE)

varnames(x) <- value

units(x, names = FALSE)

units(x) <- value

Arguments

x

A data frame or an atomic type.

names

A logical value. Applies only in case of data frames. If TRUE, attributes are extracted with corresponding column names.

value

An atomic type that represents varnames or units. The length must be 1 if x is an atomic type or equal to number of columns in x if x is a data frame.

Details

Functions check whether the extracted or assigned attributes contain elements with NULL, NA, "" values or if length of each element is higher than 1. In these cases, such elements are substituted with "-".

Value

For varnames and units, a character vector. For varnames<- and units<-, the updated object x.


grahamstewart12/tidyflux documentation built on June 4, 2019, 7:44 a.m.