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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.