Skip to content

Adds infrastructure commonly needed when using compiled code:

  • Creates src/

  • Adds required packages to DESCRIPTION

  • May create an initial placeholder .c or .cpp file

  • Creates Makevars and files (use_rcpp_armadillo() only)


use_rcpp(name = NULL)

use_rcpp_armadillo(name = NULL)

use_rcpp_eigen(name = NULL)

use_c(name = NULL)



If supplied, creates and opens src/name.{c,cpp}.


When using compiled code, please note that there must be at least one file inside the src/ directory prior to building the package. As a result, if an empty src/ directory is detected, either a .c or .cpp file will be added.