/swish/pack/rserve_client/prolog/r/r_serve.pl
All Application Manual Name SummaryHelp

  • prolog
    • r
      • r_call.pl -- R plugin for SWISH
      • r_serve.pl -- SWI-Prolog Rserve client
        • r_open/2
        • r_close/1
        • r_login/3
        • r_assign/3
        • r_eval/3
        • r_eval_ex/3
        • r_eval/2
        • r_read_file/3
        • r_remove_file/2
        • r_open_hook/2
        • r_detach/2
        • r_resume/2
        • r_resume/3
        • r_server_eval/2
        • r_server_source/2
        • r_server_shutdown/1
      • r_grammar.pl -- R parser primitives
      • r_term.pl -- Translate a Prolog term into an R expression
      • r_expand_dot.pl
      • r_data.pl -- R data frame handling
      • r_sandbox.pl -- Declare the R API safe
 r_assign(+Rserve, +VarName, +Value) is det
Assign a value to variable VarName in Rserve. Value follows a generic transformation of Prolog values into R values:
list
A list is translated into an R array of elements of the same type. The initial type is determined by the first element. If subsequent elements to not fit the type, the type is promoted. Currently defined promotions are:
  • Integers are promoted to doubles.
boolean
The Prolog atoms true and false are mapped to R booleans.
integer
Prolog integers in the range -2147483648..2147483647 are mapped to R integers.
float
Prolog floats are mapped to R doubles.
atom
Atoms other than true and false are mapped to strings.
string
A Prolog string is always mapped to an R string. The interface assumes UTF-8 encoding for R. See the encoding setting in the Rserve config file.
c(Elem1, Elem2, ...)
A compound term with functor c is handled in the same way as a list.