Learn R Programming

data.table (version 1.16.2)

cdt: data.table exported C routines

Description

Some of internally used C routines are now exported. This interface should be considered experimental. List of exported C routines and their signatures are provided below in the usage section.

Usage

# SEXP DT_subsetDT(SEXP x, SEXP rows, SEXP cols);
# p_DT_subsetDT = R_GetCCallable("data.table", "DT_subsetDT");

Arguments

Details

Details how to use those can be found in Writing R Extensions manual Linking to native routines in other packages section. An example use with Rcpp:


  dt = data.table::as.data.table(iris)
  Rcpp::cppFunction("SEXP mysub2(SEXP x, SEXP rows, SEXP cols) { return DT_subsetDT(x,rows,cols); }",
    include="#include <datatableAPI.h>",
    depends="data.table")
  mysub2(dt, 1:4, 1:4)

References

https://cran.r-project.org/doc/manuals/r-release/R-exts.html