mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-21 05:59:07 +02:00
support labelled data
This commit is contained in:
parent
5926c12da6
commit
2aa268f747
13 changed files with 188 additions and 65 deletions
|
|
@ -34,15 +34,9 @@ structure(c(1, 2, 3, 2, 10, 9),
|
|||
as_factor() |>
|
||||
fct2num()
|
||||
|
||||
# Outlier with labels, but no class of origin, handled like numeric vector
|
||||
# structure(c(1, 2, 3, 2, 10, 9),
|
||||
# labels = c(Unknown = 9, Refused = 10)
|
||||
# ) |>
|
||||
# as_factor() |>
|
||||
# fct2num()
|
||||
|
||||
v <- sample(6:19, 20, TRUE) |> factor()
|
||||
dput(v)
|
||||
named_levels(v)
|
||||
fct2num(v)
|
||||
structure(c(1, 2, 3, 2, 10, 9),
|
||||
labels = c(Unknown = 9, Refused = 10)
|
||||
) |>
|
||||
as_factor() |>
|
||||
fct2num()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue