RCL uses CFFI to communicate with the R environment, RCLmath links with libRmath and makes some functions accessible in a much simpler way. The code is available under the MIT license. Note that there is another project working on communication between Common Lisp and R: RCLG.

rcl

Download: rcl.tar.gz (older snapshots rcl-160815.tgz, rcl-150605.tgz, rcl-141102.tgz, rcl-130907.tgz, rcl-130412.tgz, rcl-090715.tgz, rcl-081007.tgz, rcl-070628.tgz, rcl-070316.tgz, rcl-060716.tgz,rcl-060703.tgz,rcl-060623.tgz).

Can be installed using quicklisp:

(ql:quickload :rcl)

To run a basic test suite:

(asdf:test-system :rcl)

It is known to work with R-4.0 on MaxOSX (SBCL 2.0 / ClozureCL 1.12 / LispWorks 7.1), Windows (SBCL 2.0 / LispWorks 7.1 / ABCL 1.8) and Linux (SBCL 2.0 / ClozureCL 1.12 / LispWorks 7.1).

In some implementations, you'll need to ensure R_PATH is properly set. In Windows, the PATH variable might have to be modified for DLLs to be found (R.dll depends on others). You might also need to edit the library path in config.lisp; if rcl:*r-lib-loaded* is nil, try (cffi:load-foreign-library *r-lib*) to see what's the problem (see init.lisp).

CL-USER> (in-package :rcl)
#<PACKAGE "RCL">
R> (r-init)
:RUNNING
R> (r "R.Version")
(("nickname" "Bunny-Wunnies Freak Out")
 ("version.string" "R version 4.0.3 (2020-10-10)") ("language" "R")
 ("svn rev" "79318") ("day" "10") ("month" "10") ("year" "2020")
 ("minor" "0.3") ("major" "4") ("status" "") ("system" "x86_64, darwin17.0")
 ("os" "darwin17.0") ("arch" "x86_64") ("platform" "x86_64-apple-darwin17.0"))