C++ function and data.table

datatable
#1

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

#2

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.

0 Likes

#4

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

0 Likes

#5

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

closed #6

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.

0 Likes