Guile-R

Stefan Israelsson <[email protected]> Sun, 27 Apr 2025 19:50:59 +0200
Newsgroups gmane.lisp.guile.devel
Message-ID <CAG504wN_GNbeGv-Z_dm3ZZagz+n=y3doUin9wyR6J1V6cx8a5Q@mail.gmail.com>
Hi,

I have just finished the initial code for managing a R session from guile
and you can find the project at,

https://gitlab.com/snorgers1/guile-r

Here is the README

GUILE-R

This is a thin wrapper towards an embedded R session

Example

(use-modules (language r))
(define v (make-rvector "x" 'integer '(1 2 3 4)))
(vec-to-r v env)
(Rf_PrintValue (evalR "x" env))
[1] 1 2 3 4

(Rf_PrintValue (evalR "y <- 1+2" env))
[1] 3

(r-to-vec "y" env)
3

(evalR "z <- c('a','b','c')" env)

(r-to-vec "z" env)
#<rvector id="z" type=string data=("a" "b" "c")>

Regards
Snorgers