C++ function and data.table

I have tried writing r functions using Rcpp for better performance. If I need to create a new column in data.table, is it advisable to write a function using C++ instead of R? I mean, will there be any performance gain worth the effort?

1 Like

It depends on your scenario.
For the best performance is Rcpp. However, data.table [,:=,] (equal to dplyr::mutate) is good enough in most of scenario.

So you mean there does exist some degrees of performance gain?

data.table is a highly optimised package. I would be very surprised if the in-built functions (including :=) could be improved by writing your own code. A decrease in performance would be far more likely.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.