Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7066425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:04:51+00:00 2026-05-28T05:04:51+00:00

I am currently using ActiveState Perl 5.14 and the R project version 2.13.2. Within

  • 0

I am currently using ActiveState Perl 5.14 and the R project version 2.13.2. Within Perl I am using Statistics::R version 0.08. According to ActiveState the more recent versions of Statistics::R (through 0.24) failed to pass scrutiny and are therefore not available through the PPM.

History: I have been successfully using Perl to access R for some time to perform analysis. Now I want to generate JPEG images of the results of the analysis for easy visualization.

Here’s the problem: I can generate the images successfully from within the R console. However, when I run the same commands through Perl I only get a blank image. My console code includes (simplified, of course):

  x<-c(1,2,3,4,5)
  y<-c(5,4,3,2,1)
  jpeg("C:/temp.jpg")
  plot(x,y)
  dev.off()

And my Perl commands include (also simplified):

   $R = Statistics::R->new();
   $R->start_sharedR
   $R->send("x<-c(1,2,3,4,5)");
   $R->send("y<-c(5,4,3,2,1)");
   $R->send('jpeg("C:/temp.jpg")');
   $R->send("plot(x,y)");
   $R->send("dev.off()");

Any suggestions? I know that there are other plotting options accessible to Perl. I have eliminated some (GD Graph) because X-axis data is not treated as numeric. I’d prefer to keep it in R if at all possible since I’m already interacting in that package for the analysis. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:04:51+00:00Added an answer on May 28, 2026 at 5:04 am

    Forget Statistics::R. Just use a system call. At least it’s what I do!

    my $path_to_r = "C:/Program Files/R/bin/Rscript.exe";
    
    my $cmd = "x<-c(1,2,3,4,5);";
    $cmd .= "y<-c(5,4,3,2,1);";
    $cmd .= 'jpeg("C:/temp.jpg");';
    $cmd .= "plot(x,y);";
    $cmd .= "dev.off()";
    
    system($path_to_r . " -e '" . $cmd . "'");
    

    If your R script grows up a bit or if it takes input from the parameters, write it in a file and Rscript.exe this file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather
Currently using Telerik ASP .NET MVC Controls version 2011.2.712 Hello all, I am trying
Im currently using C# to pass some objects to powershell and executing a method
Currently using Gettext on a project and the .po files are nicely kept under
I currently using my own membership implementation on a ASP.MVC project. I've got an
Currently using MySQL version 5.1.6 This is my first real world build and so
currently using jq 1.4.2 And i have gone through this forum and other forums
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Currently using the HTTPServletRequest class and specifically the .getQueryString method to retrieve an inputted
Currently using Google Analytics as a supplement to our paid tracking software, but neither

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.