How to Use the commonsMath Package

David B. Dahl

Overview

The commonsMath package provides access to the Apache Commons Mathematics Library. It can can accessed via the:

We demonstrate below how to use it in:

Usage in R Scripts

Access via rscala

## [1] -1.167763

Access via rJava

## [1] -1.167763

Usage in R Packages

Access via rscala

The DESCRIPTION should have Imports: rscala, commonsMath.

The NAMESPACE should have import(rscala).

Define an .onLoad function like the following:

Package functions can then assess classes and methods from the commonsMath package, e.g.:

Access via rJava

The DESCRIPTION should have Imports: rJava, commonsMath.

The NAMESPACE should first have import(rscala) and then have import(commonsMath).

Define an .onLoad function like the following:

Package functions can then assess classes and methods from the commonsMath package, e.g.: