Statis...:Rserve(3pm)
π Statistics::R::IO::Rserve β the perl doc for it, bestie edition π
okay so this is the manual page for Statistics::R::IO::Rserve, part of the Statistics::R::IO family of Perl docs. yes the header up there says Statis...:Rserve(3pm) because terminal headers are cowards who truncate. we move.
β¨ NAME β¨
Statistics::R::IO::Rserve β it hands you object methods for talking to Rserve, fr fr. π«Ά
πΈ VERSION πΈ
version 1.0002 β that's the one, no cap.
π¦ SYNOPSIS π¦
use Statistics::R::IO::Rserve;
my $rserve = Statistics::R::IO::RDS->new('someserver');
my $var = $rserve->eval('1+1');
print $var->to_pl;
$rserve->close;
look at that. four lines. iconic behavior. π
π DESCRIPTION π
Statistics::R::IO::Rserve is giving you an object-oriented interface so your Perl code can chat with the Rserve binary R server (the Rserve website lives at <http://www.rforge.net/Rserve/> β that link is literally in the original, i'm not making it up π).
and the way this is so useful?? it means your Perl programs get access to all facilities of R without you needing a local install of R, and without linking to an R library. no R on your machine, no linking drama, just vibes and sockets. β¨
π METHODS π
π CONSTRUCTOR π
new $serverβ the single-argument constructor, and you can call it with a scalar holding the host name of the Rserve server. it will immediately open a connection to that server usingIO::Socket::INETand do the initial steps prescribed by the protocol. and bestie, listen: it will raise an exception if the connection can't be established, or if the remote host doesn't appear to be running the correct version of Rserve. so, like, no silent failure energy here. πnew $handleβ the single-argument constructor can also be invoked with an instance ofIO::Handleholding the connection to the Rserve server, and that becomes the'fh'attribute. heads up tho: the caller is responsible for making sure the connection is established and ready for submitting client requests. that's on you, not on the module. π«‘new ATTRIBUTE_HASH_OR_HASH_REFβ the constructor's arguments can also come as a hash or a hash reference, specifying values of the object attributes. and same rule as above: the caller passing the handle is responsible for ensuring the connection is established and ready for submitting client requests. πnewβ the no-argument constructor. it uses the default server name'localhost'and port6311, and it immediately opens a connection to the server usingIO::Socket::INET, performing the initial steps prescribed by the protocol. and yes, same warning as the first one: it will raise an exception if the connection cannot be established or if the remote host does not appear to run the correct version of Rserve. π
π ACCESSORS π
serverβ name of the Rserve server. that's it, that's the whole thing.portβ port of the Rserve server. slay.fhβ a connection handle to the Rserve server, stored as a reference to theIO::Handle. π
β METHODS β
eval EXPRβ evaluates an R expression, given as a text string in REXPR, on an Rserve server (yep, <http://www.rforge.net/Rserve/> again) and returns its result as aStatistics::R::REXPobject. this is the main character method. πser_eval EXPRβ evaluates an R expression, given as a text string in REXPR, on an Rserve server (<http://www.rforge.net/Rserve/>) and returns its result as aStatistics::R::REXPobject. sounds the same aseval?? well, this one uses theCMD_serEvalRserve command (code0xf5), which is designated as "internal/special" and "should not be used by clients". so, consequently, it is not recommended to use this method in a production environment β only to help debug cases whereevalisn't working as desired. it's the "for science only" button, bestie. π§ͺ
ngl that quote is from the original, not from me. the module is snitching on its own method.
get_file REMOTE_NAME [, LOCAL_NAME]β transfers a file named REMOTE_NAME from the Rserve server over to your local machine, copying it to LOCAL_NAME if you specified it. the file is transferred in binary mode. returns the contents of the file as a scalar. πcloseβ closes the object's filehandle. and here's the tea: this method is automatically invoked when the object is destroyed if the connection was opened by the constructor, but not if it was passed in as a pre-opened handle. so if you handed it a handle, you clean up your own mess. π
π BUGS AND LIMITATIONS π
instances of this class are intended to be immutable. please do not try to change their value or attributes. it said what it said. π
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. go where the support lives, bestie.
π AUTHOR π
Davor Cubranic <cubranic@stat.ubc.ca> β shoutout to the author, legend behavior. π
π COPYRIGHT AND LICENSE π
this software is Copyright (c) 2017 by University of British Columbia.
this is free software, licensed under:
The GNU General Public License, Version 3, June 2007
and that's the whole page, bestie!! this was Statis...:Rserve(3pm) from the User Contributed Perl Documentation, generated by perl v5.34.0, dated 2022-02-10. mwah, go talk to your R server. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian bookworm: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- debian trixie: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu jammy: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu noble: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu resolute: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- ubuntu stonking: libstatistics-r-io-perl 1.0002-2 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms