-
Notifications
You must be signed in to change notification settings - Fork 8
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
as.character(as.item(..., missing.values = 0, ...)) returns NA instead of a string #52
Comments
PS: I corrected a typo in my post. With the typo there was no error. Now, there is the error. |
This is not a bug, but a feature. Values equal to If you want to retain "PNR" as a valid factor level, you have to declare
or
or
If in earlier versions of memisc |
Well, this is a pity because this "bug" was really convenient: it allowed me to run regressions without dropping data ('PNR' were considered as a response category, which it is) while allowing me to treat these 'PNR' as missing in the analysis (i.e. have |
I think
or
will do what you want it to do with newer versions of memisc. |
In this particular case, yes, because I convert the variable in a factor anyway. But I noticed other parts of the code where the update causes issues, namely regressions. I'd need to transform each item variable to a factor in my regressions with the new memisc version. Easier (and more compact code) to keep the old one. |
Since an update in memisc (somewhere between 0.99.22 and 0.99.28), the following code returns an error:
Before the update (I had 0.99.22), we had:
foo = c('PNR', 'Yes', 'Yes', 'No')
while now we havefoo = c(NA, 'Yes', 'Yes', 'No')
.This is a weird behavior because the point of memisc is to distinguish missing values from
NA
.Can you revert to the previous behavior?
The text was updated successfully, but these errors were encountered: