use R; #Allows use of R references called between Perl and R use RReferences; package R; package R::startR; use lib 'R'; use Exporter 'import'; @EXPORT_OK = qw(startR AUTOLOAD); &R::startR("--silent"); R::call("pdf"); #### package R; use strict; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); use Carp; require Exporter; require DynaLoader; require AutoLoader; @ISA = qw(Exporter DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @EXPORT = qw(startR AUTOLOAD ); $VERSION = '0.01'; bootstrap R $VERSION; # Preloaded methods go here. sub startR { # If R_HOME is not in the environment table, put in the value from # the installation probes. initR(@_); return(1); } # This used to be a native routine. This is now here to maintain the API # but we slide in code to set the R_HOME variable if need be. sub initR { if(0) { croak("no support for R embedded within Perl"); } setRHome(); initRSession(@_);