.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Statistics::R::IO::Rserve 3pm" .TH Statistics::R::IO::Rserve 3pm "2022-02-10" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Statistics::R::IO::Rserve \- Supply object methods for Rserve communication .SH "VERSION" .IX Header "VERSION" version 1.0002 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Statistics::R::IO::Rserve; \& \& my $rserve = Statistics::R::IO::RDS\->new(\*(Aqsomeserver\*(Aq); \& my $var = $rserve\->eval(\*(Aq1+1\*(Aq); \& print $var\->to_pl; \& $rserve\->close; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Statistics::R::IO::Rserve\*(C'\fR provides an object-oriented interface to communicate with the Rserve binary R server. .PP This allows Perl programs to access all facilities of R without the need to have a local install of R or link to an R library. .SH "METHODS" .IX Header "METHODS" .SS "\s-1CONSTRUCTOR\s0" .IX Subsection "CONSTRUCTOR" .ie n .IP "new $server" 4 .el .IP "new \f(CW$server\fR" 4 .IX Item "new $server" The single-argument constructor can be invoked with a scalar containing the host name of the Rserve server. The method will immediately open a connection to the server using IO::Socket::INET and perform the initial steps prescribed by the protocol. The method 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. .ie n .IP "new $handle" 4 .el .IP "new \f(CW$handle\fR" 4 .IX Item "new $handle" The single-argument constructor can be invoked with an instance of IO::Handle containing the connection to the Rserve server, which becomes the 'fh' attribute. The caller is responsible for ensuring that the connection is established and ready for submitting client requests. .IP "new \s-1ATTRIBUTE_HASH_OR_HASH_REF\s0" 4 .IX Item "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. The caller passing the handle is responsible for ensuring that the connection is established and ready for submitting client requests. .IP "new" 4 .IX Item "new" The no-argument constructor uses the default server name 'localhost' and port 6311 and immediately opens a connection to the server using IO::Socket::INET, performing the initial steps prescribed by the protocol. The method 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. .SS "\s-1ACCESSORS\s0" .IX Subsection "ACCESSORS" .IP "server" 4 .IX Item "server" Name of the Rserve server. .IP "port" 4 .IX Item "port" Port of the Rserve server. .IP "fh" 4 .IX Item "fh" A connection handle (stored as a reference to the IO::Handle) to the Rserve server. .SS "\s-1METHODS\s0" .IX Subsection "METHODS" .IP "eval \s-1EXPR\s0" 4 .IX Item "eval EXPR" Evaluates an R expression, given as text string in \s-1REXPR,\s0 on an Rserve server and returns its result as a Statistics::R::REXP object. .IP "ser_eval \s-1EXPR\s0" 4 .IX Item "ser_eval EXPR" Evaluates an R expression, given as text string in \s-1REXPR,\s0 on an Rserve server and returns its result as a Statistics::R::REXP object. This method uses the CMD_serEval Rserve command (code 0xf5), which is designated as \*(L"internal/special\*(R" and \*(L"should not be used by clients\*(R". Consequently, it is not recommended to use this method in a production environment, but only to help debug cases where \f(CW\*(C`eval\*(C'\fR isn't working as desired. .IP "get_file \s-1REMOTE_NAME\s0 [, \s-1LOCAL_NAME\s0]" 4 .IX Item "get_file REMOTE_NAME [, LOCAL_NAME]" Transfers a file named \s-1REMOTE_NAME\s0 from the Rserve server to the local machine, copying it to \s-1LOCAL_NAME\s0 if it is specified. The file is transferred in binary mode. Returns the contents of the file as a scalar. .IP "close" 4 .IX Item "close" Closes the object's filehandle. 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. .SH "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" Instances of this class are intended to be immutable. Please do not try to change their value or attributes. .PP There are no known bugs in this module. Please see Statistics::R::IO for bug reporting. .SH "SUPPORT" .IX Header "SUPPORT" See Statistics::R::IO for support and contact information. .SH "AUTHOR" .IX Header "AUTHOR" Davor Cubranic .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2017 by University of British Columbia. .PP This is free software, licensed under: .PP .Vb 1 \& The GNU General Public License, Version 3, June 2007 .Ve