roll icon indicating copy to clipboard operation
roll copied to clipboard

apply user defined function

Open ywhcuhk opened this issue 4 years ago • 2 comments

Thanks for the great package. Any chance we can have a zoo::roll_apply type of thing?

ywhcuhk avatar Jun 20 '20 14:06 ywhcuhk

Thanks for the feedback. I don't have plans to support user-defined functions because there's not much value the roll package could add relative to existing implementations. Specifically the advantage of the roll package is fast and efficient computation via online algorithms that are implemented in parallelized C++. In contrast, a user-defined function is unable to take advantage of these benefits, e.g. RcppParallel requires code not call R in any fashion (read more here: http://rcppcore.github.io/RcppParallel/#thread_safety). For these reasons, the marginal benefit of another implementation is low.

jasonjfoster avatar Jul 01 '20 18:07 jasonjfoster

Point well taken. A thing to consider is that roll can then provide a one stop solution to all the rolling functions. In any case, thanks again for the great package!

ywhcuhk avatar Jul 02 '20 01:07 ywhcuhk