Unable to execute java by using the Rscript
1
0
Entering edit mode
aaryan • 0
@aaryan-8212
Last seen 8.9 years ago
India

Hello Guys!!
I am trying to run the ArrayQualityMetrics Rscript from my java code. But it is not running through the java code
Any suggestions please are appreciated ........

my java code is:-

    public class TestClass {
         public static void main(String[] args) {
        // TODO Auto-generated method stub

        try{    
            Process p = Runtime.getRuntime().exec("C:/R/R-3.2.0/bin/Rscript array.R");

                        int processComplete = p.waitFor();

                           if (processComplete == 0) { 
                                System.out.println("successfull");
                           } else {
                              System.out.println("Could not complete");
                           }
                        }
                        catch (Exception e)
                        {
                                       e.printStackTrace();
                                    }
         }
    }

 

I am not getting why am I getting the else output :- "Could not complete" while runnig the java code

I want to know why the messages are comming after the library(arrayQualityMetrics)

 Creating a generic function for ‘boxplot’ from package ‘graphics’ in package ‘affyPLM’
 Creating a generic function for ‘hist’ from package ‘graphics’ in package ‘affyPLM’


Help me out. I am not getting where am I getting wrong....Do reply..
Thank you...

arrayqualitymetrics java r • 1.7k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States

No idea about the return value from java. If the R code runs successfully then this is really a question about getting java to work, not arrayQualityMetrics.

As for the messages, they mean pretty much what they say. There are hist and boxplot functions in the graphics package, and when you load affyPLM, it is creating generic functions, based on the existing functions from the graphics package:

> hist
function (x, ...)
UseMethod("hist")
<bytecode: 0x2e0b718>
<environment: namespace:graphics>
> boxplot
function (x, ...)
UseMethod("boxplot")
<bytecode: 0x1e88988>
<environment: namespace:graphics>

> library(affyPLM)

> hist
standardGeneric for "hist" defined from package "graphics"

function (x, ...)
standardGeneric("hist")
<environment: 0x41984d0>
Methods may be defined for arguments: x
Use  showMethods("hist")  for currently available ones.
> boxplot
standardGeneric for "boxplot" defined from package "graphics"

function (x, ...)
standardGeneric("boxplot")
<environment: 0x22ca1e8>
Methods may be defined for arguments: x
Use  showMethods("boxplot")  for currently available ones.

In other words, hist() and boxplot() are S3 methods in the graphics package, and affyPLM creates S4 methods based on the existing S3 packages. S3 is an earlier object oriented programming paradigm used in R (some might argue that it isn't really OO at all), and S4 is a more modern version of OO programming.

ADD COMMENT
0
Entering edit mode

Thank you for your reply...I will go for java to question. And what about the warning messages I am getting in the end....
Can you tell what is problem in that case. Is it because of the text files I am taking into the program or is it because of the R script......


 

ADD REPLY
0
Entering edit mode

You don't show any warning messages. You just show messages that are informative. And the bulk of my previous response was intended to explain those messages, so you should re-read. If there is something unclear in my explanation, please let me know.

ADD REPLY

Login before adding your answer.

Traffic: 466 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6