mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-19 13:17:30 +02:00
Deploying to gh-pages from @ agdamsbo/REDCapCAST@db75c3313e 🚀
This commit is contained in:
parent
bc2e23a272
commit
0b30252598
171 changed files with 7009 additions and 602 deletions
41
reference/haven_all_levels.md
Normal file
41
reference/haven_all_levels.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# Finish incomplete haven attributes substituting missings with values
|
||||
|
||||
Finish incomplete haven attributes substituting missings with values
|
||||
|
||||
## Usage
|
||||
|
||||
``` r
|
||||
haven_all_levels(data)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- data:
|
||||
|
||||
haven labelled variable
|
||||
|
||||
## Value
|
||||
|
||||
named vector
|
||||
|
||||
## Examples
|
||||
|
||||
``` r
|
||||
ds <- structure(c(1, 2, 3, 2, 10, 9),
|
||||
labels = c(Unknown = 9, Refused = 10),
|
||||
class = "haven_labelled"
|
||||
)
|
||||
haven::is.labelled(ds)
|
||||
#> [1] TRUE
|
||||
attributes(ds)
|
||||
#> $labels
|
||||
#> Unknown Refused
|
||||
#> 9 10
|
||||
#>
|
||||
#> $class
|
||||
#> [1] "haven_labelled"
|
||||
#>
|
||||
ds |> haven_all_levels()
|
||||
#> 1 2 3 Unknown Refused
|
||||
#> 1 2 3 9 10
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue