NAME

Rserve::REXP::Vector - an R vector

SYNOPSIS

use Rserve::REXP::Vector;

# $vec is an instance of Vector
$vec->does('Rserve::REXP::Vector');
print $vec->elements;

DESCRIPTION

An object of this class represents an R vector. This class cannot be directly instantiated (it will die if you call new on it), because it is intended as a base abstract class with concrete subclasses to represent specific types of vectors, such as numeric or list.

METHODS

Rserve::REXP::Vector inherits from Rserve::REXP.

ACCESSORS

elements

Returns an array reference to the vector's elements.

to_perl

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

type

Human-friendly description of the vector type (e.g., "double" vs. "list"). For the true R type, use sexptype.