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
Calling na.locf() on an xts object that is all NA except for the first row doesn't propagate the first row value to all subsequent rows. Coercing to zoo and running na.locf() works correctly and caries the values forward.
na.locf()
NA
x <- .xts(matrix(NA_integer_, 5, 2), 1:5) x[1,] <- 1:2 na.locf(x) # [,1] [,2] # 1969-12-31 18:00:01 1 NA # 1969-12-31 18:00:02 1 NA # 1969-12-31 18:00:03 NA NA # 1969-12-31 18:00:04 NA NA # 1969-12-31 18:00:05 NA NA na.locf(as.zoo(x)) # # 1969-12-31 18:00:01 1 2 # 1969-12-31 18:00:02 1 2 # 1969-12-31 18:00:03 1 2 # 1969-12-31 18:00:04 1 2 # 1969-12-31 18:00:05 1 2
Thanks to Christopher Katsulis (via email) for the report and reproducible example!
The text was updated successfully, but these errors were encountered:
31b5911
In windows, I am currently getting the following error
Error in na.locf.xts(data) : na.locf.xts only handles univariate, dimensioned data
Sorry, something went wrong.
In windows, I am currently getting the following error Error in na.locf.xts(data) : na.locf.xts only handles univariate, dimensioned data
Following up here, since this was resolved via private email. Here's my reply:
That's weird. It suggests you're not using the latest master from GitHub, because I don't see that error text in the code: josh@thinkpad: /storage/git/R/xts (master) > grep "only handles" -r * josh@thinkpad: /storage/git/R/xts (master) Can you double-check that you have the latest HEAD from master?
That's weird. It suggests you're not using the latest master from GitHub, because I don't see that error text in the code:
josh@thinkpad: /storage/git/R/xts (master) > grep "only handles" -r * josh@thinkpad: /storage/git/R/xts (master)
Can you double-check that you have the latest HEAD from master?
And I asked in a different email thread:
Did you get your Windows na.locf.xts "by-column" error sorted out?
and Chris replied
I believe yes.... deleted the folder and reinstalled from github
joshuaulrich
No branches or pull requests
Calling
na.locf()
on an xts object that is allNA
except for the first row doesn't propagate the first row value to all subsequent rows. Coercing to zoo and runningna.locf()
works correctly and caries the values forward.Thanks to Christopher Katsulis (via email) for the report and reproducible example!
The text was updated successfully, but these errors were encountered: