You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I do not know how many times R-novice colleagues have misunderstood the labelled-class vs. factor-distinction when importing Stata/SPSS-data. In our organization and field, custom missing types are very rare and obscure, so I can safely tell them to always use labelled::unlabelled(), which they of course find counter-intuitive (they don't want to remove labels! :) ). This issue might even trip up the experienced R-user who for the first time has to import a Stata/SPSS dataset and jumps into regression-analyses.
I understand the need for labelled-class, but could we perhaps generate a one-liner warning/notification? Perhaps something like this IF there are no multiple NAs across the categorical variables.
cli::cli_inform(c(i="You likely want to convert categorical variabels from {.cls labelled}-class to {.cls factor} before data-analyses."))
#> ℹ You likely want to convert categorical variabels from <labelled>-class to <factor> before data-analyses.
It could be suppressed with an argument that defaults to FALSE. And perhaps also respecting a option("haven.quiet_labelled_notification" = TRUE) for the more advanced users.
The text was updated successfully, but these errors were encountered:
I'm reluctant to add a message like this to the package since it would be quite noisy and it's a fundamental part of the package that is mentioned prominently in the README.
Having said that, it could definitely be more clearly noted in the documentation for the read_*() functions. I think we're due for a general documentation cleanup, so I'll keep this in mind as part of that.
I do not know how many times R-novice colleagues have misunderstood the
labelled
-class vs.factor
-distinction when importing Stata/SPSS-data. In our organization and field, custom missing types are very rare and obscure, so I can safely tell them to always use labelled::unlabelled(), which they of course find counter-intuitive (they don't want to remove labels! :) ). This issue might even trip up the experienced R-user who for the first time has to import a Stata/SPSS dataset and jumps into regression-analyses.I understand the need for labelled-class, but could we perhaps generate a one-liner warning/notification? Perhaps something like this IF there are no multiple NAs across the categorical variables.
It could be suppressed with an argument that defaults to FALSE. And perhaps also respecting a
option("haven.quiet_labelled_notification" = TRUE)
for the more advanced users.The text was updated successfully, but these errors were encountered: