Aliases a data.frame. Replaces column names with labels, where present. Stores column name as 'alias' attribute.
Usage
# S3 method for class 'data.frame'
alias(object, ...)See also
Other labels:
append_units(),
append_units.data.frame(),
append_units.default(),
drop_title(),
drop_title.decorated(),
drop_title.default(),
drop_title.dvec(),
make_title(),
make_title.decorated(),
make_title.default(),
make_title.dvec(),
sub_units()
Other deprecated:
append_units(),
drop_title(),
make_title()
Examples
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
#> 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
alias(d)
#> 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
alias(d, y)
#> 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