Skip to contents

Resolves implicit usage of default key 'guide' to explicit usage for class dvec. Simply calls explicit_guide followed by classified if x has a codelist attribute. If option yamlet_with_title is not NULL, and if 'units' present, label and units will be concatenated by default to create a title attribute.

Usage

# S3 method for class 'dvec'
resolve(x, ...)

Arguments

x

dvec

...

passed to explicit_guide, classified, and make_title

Value

dvec or classified

Examples

library(magrittr)
x <- as_dvec(1:3, guide = list(a = 1, b = 2, c = 3))
x %>% str
#>  'dvec' int [1:3] 1 2 3
#>  - attr(*, "guide")=List of 3
#>   ..$ a: num 1
#>   ..$ b: num 2
#>   ..$ c: num 3
x %>% classified %>% str
#>  Factor w/ 3 levels "1","2","3": 1 2 3
#>  - attr(*, "guide")=List of 3
#>   ..$ a: num 1
#>   ..$ b: num 2
#>   ..$ c: num 3
#>  - attr(*, "codelist")=List of 3
#>   ..$ : chr "1"
#>   ..$ : chr "2"
#>   ..$ : chr "3"
x %>% explicit_guide %>% classified %>% str
#>  Factor w/ 3 levels "a","b","c": 1 2 3
#>  - attr(*, "codelist")=List of 3
#>   ..$ 1: chr "a"
#>   ..$ 2: chr "b"
#>   ..$ 3: chr "c"
x %>% resolve %>% str
#>  Factor w/ 3 levels "a","b","c": 1 2 3
#>  - attr(*, "codelist")=List of 3
#>   ..$ 1: chr "a"
#>   ..$ 2: chr "b"
#>   ..$ 3: chr "c"