-
Notifications
You must be signed in to change notification settings - Fork 0
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
corx function fails in the presence of *value* labels (not just variable labels) #11
Comments
Thanks for pointing this out, for providing a reproducible example, and for this kind feedback. I've pushed an update to github that should resolve this issue on branch 1.0.7.3. I'll give it some time before pushing to CRAN to give myself more time to identify any mistakes. I'll consider issue #10 more, I'm a little worried that mistakes will be made as it's not always obvious how factors should be converted to numeric and it's easy to miss warnings. Perhaps making users select this with an argument would be safer.
|
Thanks for tackling this! And yes I think Issue #10 is a tougher one. Perhaps instead/in addition to a warning, the resulting corx object could add a 'warnings' vector and/or modify the default print method. In this way, right above the correlation matrix, the user could be shown a message making clear that a conversion was done, and why that might give unanticipated or misleading results. For better or worse, other correlation packages (to my knowledge?) don't error in cases where factors are present, but then again perhaps they should. |
Hi @conig,
Thanks for a great package - I find it to be the best for APA-ready tables, and used it in my dissertation. However, I've found the need to remove all label attributes from my dataset before it can work. (For anyone reading, it's possible to quickly remove all labels by passing your data frame/tibble into the
labelled::remove_labels()
function, or, if that doesn't work,sjlabelled::remove_all_labels()
.) In a past Issue here, variable labels (i.e., the description of the variable itself) were tackled, but not value labels.The
corx::corx()
function still fails in the presence of value labels, i.e., label attributes that can be linked to specific numeric values in a numeric vector. These are common in SPSS-imported data.In the example below, corx works fine in the presence of a variable label for Sepal Length
$Sepal.Length$label
but fails in the presence of value labels for Sepal Length$Sepal.Length$labels
:Here's a reprex
Console output from Reprex
sessionInfo()
I'm happy to provide any more info or context. Once this and Issue 10 (handling factor -> numeric) are resolved, I really think you should promote the heck out of this package! From the perspective of an academic in social science, it's really great in the options it provides. Thanks and take care.
The text was updated successfully, but these errors were encountered: