I am trying to call R in Perl using RS Perl but I keep geting this error:
Can't locate loadable object for module R in @INC (@INC contains: /usr/local/src/RSPerl/src/ ./ /usr/local/pl/libAll /usr/local/lib64/perl5.16.0/lib /usr/local/perl5.16.0/lib /usr/local/pl/libAll/Statistics-R-0.27/lib /usr/lib/perl5/vendor_perl /usr/local/pl/libAll/Tk /usr/local/pl/libAll/Tk/Event /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .)
I am quite sure that R is installed properly.I am using Perl v5.10.1 , R 3.1.3 and RSPerl 0.92-1.
Here is the code:
sub setup_R { #Uses R library #R= '/usr/local/src/RSPerl/R.pm'; #my $R = Statistics::R->new( bin => $fullpath ); #use lib "/usr/local/src/RSPerl/src/"; #use lib "/usr/local/pl/libAll/Statistics-R-0.27/lib/Statistics/"; #use lib "/usr/local/pl/libAll/Regexp-Common-2011121001/lib/"; #use lib "/usr/local/perl5.16.0/lib/site_perl/5.16.0/"; use lib "/usr/local/src/RSPerl/src/"; use R; #Allows use of R references called between Perl and R use RReferences; #Starts the R module &R::startR("--silent"); #Sets the output for R plots, "pdf" for *.pdf output. "X11" to simply + pull up on screen R::call("pdf"); #Sets the X and Y limits for the plot @xlim=R::c(0,5000); @ylim=R::c(-5,2); #Calls for a blank plot by putting one point at -10,-10 which is off t +he plotting area, sets labels and limits as specified R::callWithNames("plot",{'x',-10,'y',-10,xlim,\@xlim,ylim,\@ylim,x +lab,'Frequency(Hz)',ylab,'LN(A/A0)'});
In reply to Calling R in Perl using RSPerl by rkeshvardoost
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |