Rserve::REXP::Language - an R language vector
use Rserve::REXP::Language
# Representation of the R call C<mean(c(1, 2, 3))>:
my $vec = Rserve::REXP::Language->new([
Rserve::REXP::Symbol->new('mean'),
Rserve::REXP::Double->new([1, 2, 3])
]);
print $vec->elements;
An object of this class represents an R language vector (LANGSXP
). These objects represent calls (such as model formulae), with first element a reference to the function being called, and the remainder the actual arguments of the call. Names of arguments, if given, are recorded in the 'names' attribute (itself as Rserve::REXP::Character vector), with unnamed arguments having name ''
. If no arguments were named, the language objects will not have a defined 'names' attribute.
Rserve::REXP:Language
inherits from Rserve::REXP::Vector, with the added restriction that its first element has to be a Rserve::REXP::Symbol or another Language
instance. Trying to create a Language instance that doesn't follow this restriction will raise an exception.
SEXPTYPE of language vectors is LANGSXP
.
Perl value of the language vector is an array reference to the Perl values of its elements
. (That is, it's equivalent to map {$_->to_perl}, $vec->elements
.)