public void toFile(File file, Engine engine,
            InputVariable a, InputVariable b, Reader reader,
            List<OutputVariable> outputVariables) throws IOException {
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream(file), FuzzyLite.UTF_8));
        try {
            writeScriptExportingDataFrame(engine, writer, a, b, reader, outputVariables);
        } catch (RuntimeException ex) {
            throw ex;
        } catch (IOException ex) {
            throw ex;
        } finally {
            writer.close();
        }
    }
public void toFile ( File file , Engine engine , InputVariable a , InputVariable b , Reader reader , List < OutputVariable > outputVariables ) throws IOException { BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( file ) , FuzzyLite . UTF_8 ) ) ; try { writeScriptExportingDataFrame ( engine , writer , a , b , reader , outputVariables ) ; } catch ( RuntimeException ex ) { throw ex ; } catch ( IOException ex ) { throw ex ; } finally { writer . close ( ) ; } }
Creates an R script file plotting multiple surfaces based on the input
stream of values for the two input variables.

@param file is the R script file
@param engine is the engine to export
@param a is the first input variable
@param b is the second input variable
@param reader is an input stream of data whose lines contain
space-separated input values
@param outputVariables are the output variables to create the surface for
@throws IOException if any error occurs upon writing the file