portray {rolog}R Documentation

Translate an R call to a prolog compound and pretty print it

Description

Translate an R call to a prolog compound and pretty print it

Usage

portray(
  query = call("member", expression(X), list(quote(a), "b", 3L, 4, TRUE, expression(Y))),
  options = NULL
)

Arguments

query

an R call. The R call consists of symbols, integers and real numbers, character strings, boolean values, expressions and lists, and other calls. Vectors of booleans, integers, floating point numbers, and strings with length N > 1 are translated to prolog compounds !/N, %/N, #/N and $$/N, respectively. The names can be modified with the options below.

options

This is a list of options controlling translation from and to prolog.

  • boolvec (see option rolog.boolvec, default is !) is the name of the prolog compound for vectors of booleans.

  • intvec, realvec, charvec define the compound names for vectors of integers, doubles and strings, respectively (defaults are %, # and $$).

  • If scalar is TRUE (default), vectors of length 1 are translated to scalar prolog elements. If scalar is FALSE, vectors of length 1 are also translated to compounds.

Details

The R elements are translated to the following prolog citizens:

Value

character string with the prolog syntax of the call

See Also

rolog_options() for fine-grained control over the translation


[Package rolog version 0.9.17 Index]