endpoints in xts using R

房东的猫 提交于 2019-12-05 22:12:52

as answered in the comments above and taken directly from the endpoints.c source code, the function returns this:

c(0,which(diff(_x%/%on%/%k+1) != 0),NROW(_x))

where _x = .index(my_xts)

what does this actually do? with respect to my call of the endpoints function:

the stuff inside diff first removes the seconds and then moves things into k minute increments (all this using integer division). diff then simply notes the points where you change to the next increment and which returns those points where the increment occurs. in effect this simply returns the last point in each 5 minute interval (k=5 in my call)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!