This is an example R package project that uses code written in Java.
For a concise introduction to rJava, read "Documentation" section on the webpage of the rJava project .
The goal of this project is to show the following things.
Note that in order to be able to build the project, you need to have all R packages listed in the Imports section of the
DESCRIPTION file installed in the system.
*.Rprojfile: its name
librarystatement and as an argument to
devtools::check()two NOTEs are printed related to the following things.
GNU makeis a system requirement of the package (as defined in the
DESCRIPTIONfile). This is required, because in the
java/number-adder/Makefilefile we use
ifndefconstruction which is GNU make extension with regards to POSIX make. Using GNU Make is discouraged because it is not completely portable as noted in "Writing R Extensions" document, section "Writing-portable-packages".
manare entered in
.gitignorefile. Hadley Wickham disapproves of this in his book (see chapter "Git and GitHub", paragraph starting from "Some developers never commit derived files").
If you get a cryptic error message while running the tests similar to the one below:
Error in ._jobjRef_dollar(x[["jobj"]], name) : no field, method or inner class called 'calls' Calls: <Anonymous> ... expectation_error -> $ -> $.Throwable -> ._jobjRef_dollar
this might mean that the version of Java that the source files were compiled for is incompatible with the Java version configured in R environment. The version of Java for the source files is set in
java/number-adder/pom.xml while version of Java used in R environment is set using
R CMD javareconf command.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.