Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remind the novice user of labelled-format? #741

Open
sda030 opened this issue Nov 19, 2023 · 2 comments
Open

Remind the novice user of labelled-format? #741

sda030 opened this issue Nov 19, 2023 · 2 comments

Comments

@sda030
Copy link

sda030 commented Nov 19, 2023

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.

@gorcha
Copy link
Member

gorcha commented Jan 31, 2024

Hi @sda030,

Thanks for the feedback!

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.

@sda030
Copy link
Author

sda030 commented Jan 31, 2024

Hi @gorcha, that is understandable. We found another solution with the sjlabelled::read_*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants