ciao a tutti è la prima volta che scrivo in questo forum e prima di scrivere questa nuova discussione mi sono letta tutte le vostre risposte riguardo ad argomenti simili ma non ho trovato una risposta adeguata al mio problema.
Io devo creare una classe java che richiama R-project il quale a sua volta richiamerà excell, acess e mysql.
Ho delle classi base che mi richiamano r ma mi fanno apparire la console di r.
Io non devo far apparire la console di r ma direttamente il foglio di excell, access o mysql.
Vi allego le classi che richiama la console di r mi sapreste dire come fare a richiamare r senza farmi apparire la console?
Ci ho provato in tutti i modi e non ne vengo a capo so che sarà dura ricevere risposte in quanto r non lo usa nessuno ma spero che magari qualcuno abbia già avuto a che fare con questo problema o che mi possa dare delle indicazioni a riguardo.
Ecco la classe:

import java.io.*;
import java.awt.Frame;
import java.awt.FileDialog;

import java.util.Enumeration;

import org.rosuda.JRI.Rengine;
import org.rosuda.JRI.REXP;
import org.rosuda.JRI.RList;
import org.rosuda.JRI.RVector;
import org.rosuda.JRI.RMainLoopCallbacks;

class TextConsole implements RMainLoopCallbacks
{

public void rWriteConsole(Rengine re,String text) {

System.out.print(text);

}

public void rBusy(Rengine re, int which) {
//System.out.println("rBusy("+which+")");
}

public String rReadConsole(Rengine re, String r, int addToHistory) {
try {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s=br.readLine();
return (s==null||s.length()==0)?s:s+"\n";
} catch (Exception e) {
System.out.println("jriReadConsole exception: "+e.getMessage());
}
return null;
}

public void rShowMessage(Rengine re, String message) {
// System.out.println("rShowMessage \""+message+"\"");
}

public String rChooseFile(Rengine re, int newFile) {
FileDialog fd = new FileDialog(new Frame(), (newFile==0)?"Select a file":"Select a new file", (newFile==0)?FileDialog.LOAD:FileDialog.SAVE);
fd.show();
String res=null;
if (fd.getDirectory()!=null) res=fd.getDirectory();
if (fd.getFile()!=null) res=(res==null)?fd.getFile()res+fd.getFile());
return res;
}

public void rFlushConsole (Rengine re) {
}

public void rLoadHistory (Rengine re, String filename) {
}


public void rSaveHistory (Rengine re, String filename) {
}
}

public class rtest {
public static void main(String[] args)
{

// the engine creates R is a new thread, so we should wait until it's ready
// just making sure we have the right version of everything
if (!Rengine.versionCheck()) {
System.err.println("** Version mismatch - Java files don't match library version.");
System.exit(1);
}


//System.out.println("Creating Rengine (with arguments)");

TextConsole tx=new TextConsole();

Rengine re=new Rengine(args,false,tx);
//System.out.println("Rengine created, waiting for R");


// 1) we pass the arguments from the command line
// 2) we won't use the main loop at first, we'll start it later
// (that's the "false" as second argument)
// 3) the callbacks are implemented by the TextConsole class above
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;


}

if (true) {

// so far we used R as a computational slave without REPL
// now we start the loop, so the user can use the console
//System.out.println("Ora puoi iniziare a lavorare con R");
re.startMainLoop();
} else {
re.end();
System.out.println("end");
}
}
}

e l'interfaccia che richiama

package org.rosuda.JRI;

/** Interface which must be implmented by any class that wants to pose as the call-back
handler for R event loop callbacks. It is legal to return immediately except when user
interaction is required: @link{#rReadConsole} and @link{#rChooseFile} are expected to block
until the user performs the desired action. */
public interface RMainLoopCallbacks {
/** called when R prints output to the console
@param re calling engine
@param text text to display in the console */
public void rWriteConsole (Rengine re, String text);
/** called when R enters or exist a longer evaluation. It is usually a good idea to
signal this state to the user, e.g. by changing the cursor to a "hourglass" and back.
@param re calling engine
@param which identifies whether R enters or exist the busy state */
public void rBusy (Rengine re, int which);
/** called when R waits for user input. During the duration of this callback it is safe
to re-enter R, and very often it is also the only time. The implementation is free to
block on this call until the user hits Enter, but it is a good idea to call
@{link #rniIdle} occasionally to allow other event handlers (e.g graphics device UIs)
to run. Implementations should NEVER return immediately even if there is no input - such
behavior will result in a fast cycling event loop which makes the use of R pretty
much impossible.
@param re calling engine
@param propmt prompt to be displayed at the console prior to user's input
@param addToHistory flags telling the handler whether the input should be considered
for adding to history or not
@return user's input to be passed to R for evaluation */
public String rReadConsole (Rengine re, String prompt, int addToHistory);
/** called when R want to show a warning/error message
(not to be confused with messages displayed in the console output)
@param re calling engine
@param message message to display */
public void rShowMessage (Rengine re, String message);
/** called when R expects the user to choose a file
@param re calling engine
@param newFile flag determining whether an existing or new file is to be selecteed
@return path/name of the selected file */
public String rChooseFile (Rengine re, int newFile);
/** called when R requests the console to flush any buffered output
@param re calling engine */
public void rFlushConsole (Rengine re);
/** called to save the contents of the history (the implementation is responsible
of keeping track of the history)
@param re calling engine
@param filename name of the history file */
public void rSaveHistory (Rengine re, String filename);
/** called to load the contents of the history
@param re calling engine
@param filename name of the history file */
public void rLoadHistory (Rengine re, String filename);
}


HELP MEEEEEEE!!! grazie a tutti ele

p.s:qualsiasi indicazioni di qualsiasi genere è ben accetta