-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
[R-Forge #1603] Can't use na.locf() on character data #42
Comments
Also seems that > na.omit(xts(c("a", "b", "c", NA, "d"), as.Date(1:5)))
Error in na.omit.xts(xts(c("a", "b", "c", NA, "d"), as.Date(1:5))) :
unsupported type |
xout option for na.locf / na.locf.default cannot work for character data (xts/zoo) . I found the process is fine until reaching to 26 line in na.approx |
Update na.locf() unit tests to run over the 4 major atomic types. Note that the 'xout' test does not currently run on character data because merging a character xts with a zero-width xts return a numeric result. This happens because all zero-width xts objects are numeric, and merge.xts converts all inputs to a common type. Add branch to handle character xts objects to 3 functions: firstNonNA, na_locf, and na_omit_xts. Nothing too special, just copied a branch for another type and changed the accessors to the necessary string versions. Fixes #42.
@kenahoo, I hope "better late than never" applies in this case! I didn't address the n-way merge issue on character xts because I have some significant changes to the merge C code that I would like to incorporate first. |
Submitted by: Ken Williams (@kenahoo)
Assigned to: Nobody
R-Forge link
na.locf() seems to fail on xts objects containing character data:
I can use na.locf.default() as a workaround, I don't seem to lose any fidelity in the process:
-Ken
The text was updated successfully, but these errors were encountered: