- 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.