NAME

Statistics::R::IO::RDS - Supply object methods for RDS files

VERSION

This documentation refers to version 0.03 of the module.

SYNOPSIS

use Statistics::R::IO::RDS;

my $rds = Statistics::R::IO::RDS->new('file.rds');
my $var = $rds->read;
print $var->to_pl;
$rds->close;

DESCRIPTION

Statistics::R::IO::RDS provides an object-oriented interface to parsing RDS files. RDS files store a serialization of a single R object (and, if the object contains references to other objects, such as environments, all the referenced objects as well). These files are created in R using the readRDS function and are typically named with the .rds file extension.

METHODS

CONSTRUCTOR

new $filename

The single-argument constructor can be invoked with a scalar containing the name of the RDS file. This file will be immediately opened for reading using IO::File. The method will raise an exception if the file is not readable.

new ATTRIBUTE_HASH_OR_HASH_REF

The constructor's arguments can also be given as a hash or hash reference, specifying values of the object attributes (in this case, 'fh', for which any subclass of IO::Handle can be used).

ACCESSORS

fh

A file handle (stored as a reference to the IO::Handle) to the data being parsed.

METHODS

read

Reads the contents of the filehandle and returns a Statistics::R::REXP.

close

Closes the object's filehandle. This method is automatically invoked when the object is destroyed.

BUGS AND LIMITATIONS

Instances of this class are intended to be immutable. Please do not try to change their value or attributes.

There are no known bugs in this module. Please see Statistics::R::IO for bug reporting.

SUPPORT

See Statistics::R::IO for support and contact information.

AUTHOR

Davor Cubranic, <cubranic at stat.ubc.ca>

LICENSE AND COPYRIGHT

Copyright 2014 University of British Columbia.

See Statistics::R::IO for the license.