Saturday 15 August 2015

Error under bridge between R and Java -


itemprop = "text">

I got the code below from the following website bridge connection between R & B and Rcaller using

< / P>

Under Windows NetBeans IDE it shows the following warning:

  Note: C: \ Users \ Aman \ Documents \ NetBeansProjects \ JavaApplicationRCaller \ src \ javaapplicationrcaller \ JavaApplicationRCaller.java uses or overrides a deprecated API. Note: recompiled with exclute: exclusion for details.   

But this also shows up and the result is that

  rcaller.exception.RCallerExecutionException does not print: C can not run: \ Program Files \ r \ R - 3.0.1 \ bin \ i386 \ Rscript cause: java.io.IOException: CreateProcess error = 2, the system file can not be found Specified   

This is the RScript executable code path :: C: \ Program Files \ R \ R-3.0.1 \ bin \ i386 \ rupcript

  package javaapplication example; Import rcaller.RCaller; Import java.util.Random; Public class JavaApplicationExample {public static zero main (string [] args) {new JavaApplicationExample (); } Public JavaApplicationExample () {Try {/ * * Creating Random Number Generator of Java * / Random Random = New Random (); / * * Creating a Recaller * / Recolar Collar = New R-Color (); / * * The complete path of the router is an executable file that is R. * Has been sent with. It's like C: \\ Program Files \\ R \\ Windows in Windows XP / BIN .... / / showing the same error while typing it. SetRscriptExecutable ("C: \\ Program Files \\ R \\ R3.0.1 \\ BIN \\ i386 \" RUPTITS ") * / * We get 100 * / double [] data = new double [100] size Together with zero mean and unit variance, creating a random data from normal distribution; for (int i = 0; i & lt; data. Lamps; i ++) {data [i] = random. Nxgaucien (); } / * * We are transferring the double array for R * / caller.addDoubleArray ("x", data); / * * Adding R code / / caller.addRCode ("my.mean" - main ( X) "); caller.addRCode (" my.var & lt; -var (x) "); caller.addRCode ( "My.sd & lt; -sd (x)"); caller.addRCode ("my.min & lt; cleanup MIN (x)"); caller.addRCode ("my.max; LT; max (x)" ); Caller.addRCode ("my.standardized & lt; -scale (x)"); / * * a list () object * / caller.addRCode (in all those mails "my.all & lt; -List ( Mean = my.mean, variance = my.var, sd = my.sd, minimum = my. Minimum, max = my.max, std = my.standardized) "); / * * We list 'my.all' * / Caller.runAndReturnResult ("my.all"); Double [] results; / * * List 'my.all' * / results = caller.getParser () retrieving the 'mean' element. GetAsDoubleArray ("mean"); System.out.println ("Pisces" + result [0]); Get the 'Variant' element of / * * list 'my.all' * / results = caller.getParser (). GetAsDoubleArray ("Variance"); System.out.println ("Variant" + result [0]); / * * Retrieve the 'SD' element of the list 'my.all' * / results = caller.getParser (). GetAsDoubleArray ("sd"); System.out.println ("standard deviation" + result [0]); Get the 'Minimum' element of / * * list 'my.all' * / results = caller.getParser (). GetAsDoubleArray ("min"); System.out.println ("is minimum" + result [0]); / * * List 'my.all' * / results = Caller.getParser retrieves the 'max' element. GetAsDoubleArray ("max"); System.out.println ("max is" + result [0]); / * * Retrieve the 'STD' element of 'my.all' * / results = caller.getParser (). GetAsDoubleArray ("std"); / * * We are now retrieving the standardized form of vector x * / System.out.println ("standardized x"); For (int i = 0; i & lt; result; tall; i ++) system. Out.print (result [i] + ","); } Hold (exception e) {System.out.println (e.toString ()); }}}}    

This is the last answer: by using error and installing (I should mention it here for others) following:

  install.packages ("Runiversal", repos = "cran.r-project.org")   

and then:

  install.packages ("runversal")    

No comments:

Post a Comment