Adding a new component to a DatetimeVector in Rcpp

后端 未结 1 881
清歌不尽
清歌不尽 2021-01-28 19:33

I would appreciate if someone could help me in push_back a new component into DatetimeVector. A DatetimeVector only has begin, end, getDatetimes<

相关标签:
1条回答
  • 2021-01-28 20:09

    I'd say don't. For multiple reasons:

    1. All Rcpp types uses an underlying SEXP which requires contiguous memory. So adding a single element always requires copying all--expensive.
    2. The DatetimeVector class is pretty bad. I wrote it many years ago to pass data to QuantLib.
    3. These days we can do better via simple NumericVector classes to POSIXct -- see eg here in Rblpapi
    0 讨论(0)
提交回复
热议问题