alias.data.frame: Alias a Data Frame

Description Usage Arguments Value See Also Examples

View source: R/alias.R

Description

Aliases a data.frame. Replaces column names with labels, where present. Stores column name as 'alias' attribute.

Usage

1
2
## S3 method for class 'data.frame'
alias(object, ...)

Arguments

object

data.frame

...

optional unquoted names of target columns

Value

aliased data.frame

See Also

Other labels: append_units.data.frame(), append_units.default(), append_units(), sub_units()

Other deprecated: append_units()

Examples

1
2
3
4
5
6
7
library(magrittr)
d <- data.frame(x = 1:10, y = 1:10, z = 1:10)
d %<>% modify(x, label = 'Independent Value')
d %<>% modify(y, label = 'Dependent Value')
d
alias(d)
alias(d, y)

Example output

Attaching package:yamletThe following object is masked frompackage:stats:

    filter

    x  y  z
1   1  1  1
2   2  2  2
3   3  3  3
4   4  4  4
5   5  5  5
6   6  6  6
7   7  7  7
8   8  8  8
9   9  9  9
10 10 10 10
   Independent Value Dependent Value  z
1                  1               1  1
2                  2               2  2
3                  3               3  3
4                  4               4  4
5                  5               5  5
6                  6               6  6
7                  7               7  7
8                  8               8  8
9                  9               9  9
10                10              10 10
    x Dependent Value  z
1   1               1  1
2   2               2  2
3   3               3  3
4   4               4  4
5   5               5  5
6   6               6  6
7   7               7  7
8   8               8  8
9   9               9  9
10 10              10 10

yamlet documentation built on July 19, 2021, 1:06 a.m.