Real is a c-based interface for connecting R to Prolog. See the documentation at doc/html/real.html for more information. There is also a paper doc/padl2013-real.pdf and a user's guide doc/guide.pdf, but they both refer to earlier versions of Real.
Real works on current versions of SWI and YAP. As of version 1.1 there is support for using Real on SWI web-servers.
This software can be distributed as GPL or Aristic 2.0, see prolog/real.pl.
To install stable versions:
pack_intall( real ).
Yap install Yap itself with configure --with-R
See doc/guide.pdf for further details on stable versions.
To get the latest git version goto
git clone git://www.swi-prolog.org/home/pl/git/packages/real.git
To install developmental versions do:
Install last stable real with
pack_install( real ).
pack_rebuild( real ). % to force SWI to build from sources.
and do again:
pack_rebuild( real ).
SWI-Prolog (b) clone real into pl-devel/packages/real add this to your build script export EXTRA_PKGS="real" build SWI from sources as per usual
Yap replace $YAP/packages/real with the development version you downloaded and rebuilt Yap with
pack('pack/real/examples/for_real')]. ?- for_real.
Yap ?- [examples/for_real]. ?- for_real.
Nicos Angelopoulos and Vitor Santos Costa December, 2012.
Updates: Nicos Angelopoulos Dec, 2013 Mar, 2014 May, 2015 Jan, 2016
|prolog/real.pl -- An interface to the R statistical software.|
|<-/1||If Rvar is an atom and a known R object, then print Rvar on R.|
|<-/2||Pass Prolog data PLdata to Rvar.|
|<<-/1||Nick name for |
|<<-/2||True iff Rv is a undefined R variable and Rv <- Expr succeeds.|
|r/1||Nickname for <-(R).|
|r/2||Nickname for <-(L,R).|
|r_call/2||Construct and possibly call an R function.|
|r_char/2||Wrap an atomic value with double quotes so it can pass as an R char type.|
|r_citation/2||Although the original name was R..eal, when citating please use Real as the name for this library.|
|r_devoff/0||Close the current plot devise without any reporting.|
|r_devoff_all/0||Close all open devices.|
|r_is_var/1||True if Rvar is an atom and a known variable in the R environment.|
|r_is_var/2||True if Rvar is a term and a known variable in the R environment.|
|r_library/1||Load Rlib while respecting prolog_flag/2 real_suppress_lib_messages.|
|r_remove/1||Remove Rvar from R's workspace (<- |
|r_serve/0||Serves any R calls that are waiting on the thread queue.|
|r_start/0||Start an R object.|
|r_started/1||Unifies F with true if R has been started or false if not.|
|r_thread_loop/0||Starts a loop that serves R calls received from <-/1 and <-/2 calls from other threads.|
|r_version/3||Version and release Date (|
|r_wait/0||Currently only waiting for Return to be pressed.|