-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Labels
reprexneeds a minimal reproducible exampleneeds a minimal reproducible example
Description
Hi!
fct_recode removes label attribute (and seems that it removes all the attributes). I expect it would not do (it may have sense that it removes a labels attribute, but not others).
Reprex:
library(haven)
library(forcats)
path <- system.file("examples", "iris.dta", package = "haven")
read_dta(path) |> str()
...
...
...
$ species : chr [1:150] "setosa" "setosa" "setosa" "setosa" ...
..- attr(*, "label")= chr "Species"
..- attr(*, "format.stata")= chr "%10s"
# However
read_dta(path)$species |> fct_recode(seto = "setosa") |> str()
Factor w/ 3 levels "seto","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...DanChaltiel
Metadata
Metadata
Assignees
Labels
reprexneeds a minimal reproducible exampleneeds a minimal reproducible example