如何在 R 中的 xts 时间序列中使用 na.locf 中的 maxgap?

发布于 2024-10-10 14:50:04 字数 381 浏览 0 评论 0原文

na.locf(xts_ts, maxgap=240) 似乎不尊重 xts 时间序列的 maxgap 。我认为对于 xts timeseries na.locf.xts 被调用(它没有记录 maxgap),而不是 na。 locf 来自 zoo

我做错了什么吗?

我应该将 xts ts 转换为 zoo ts,然后使用 maxgap 调用 na.locf 并转换回来到xts

na.locf(xts_ts, maxgap=240) doesn't seem to respect maxgap for xts timeseries. I think that for xts timeseries na.locf.xts is invoked (which doesn't document maxgap), and not na.locf which is from zoo.

Am I doing something wrong?

Should I convert the xts ts to a zoo ts, then call na.locf with maxgap and the convert back to xts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

埖埖迣鎅 2024-10-17 14:50:04

自修订版 553 起,maxgap 包含在 R-forge 上的 na.locf.xts 中。使用 install.packages("xts", repos="http:// /R-Forge.R-project.org") 从 R-forge 获取最新版本。

maxgap is included in na.locf.xts on R-forge as of revision 553. Use install.packages("xts", repos="http://R-Forge.R-project.org") to get the latest revision from R-forge.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文