Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I compile my R package in bytecode?

Tags:

r

packages

Can I compile my R package in bytecode? I have an R package and I want to compile it with

R CMD INSTALL --build mypackage.tar.gz 

but I want the R code to be compiled into bytecode. Is this possible in R 2.14.0?

like image 534
power Avatar asked Nov 02 '11 06:11

power


1 Answers

Yes, this is listed in the NEWS for R 2.14 and in the R extensions manual.

NEWS:

R CMD INSTALL has a new option --byte-compile to byte-compile the packages during installation (since all packages are now lazy-loaded). This can be controlled on a per-package basis by the optional field ByteCompile in the DESCRIPTION file.

The ByteCompile field is described in section 1.1.1 of the "Writing R Extensions" manual for the DESCRIPTION file.

The manuals on CRAN are still 2.13.2 so I looked in the installed version of the extensions manual for that.

like image 121
mdsumner Avatar answered Sep 30 '22 01:09

mdsumner