java.lang.Object
de.uka.ipd.sdq.sensorframework.visualisation.rvisualisation.utils.REngineHelper

public class REngineHelper extends Object
Provides helper method for working with the R engine and the SensorFramework. The class offers methods for feeding sensor data into R and may later also provide methods for more complex commands and calculation.
  • Field Details

  • Constructor Details

    • REngineHelper

      public REngineHelper()
  • Method Details

    • storeMeasurementsInRVector

      public static String storeMeasurementsInRVector(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, RConnection rConnection)
      Parameters:
      measurements - Measurements for a sensor.
      sensorNumber - number of the sensor vector in R.
      dataSelection - the data element to save.
      rConnection - Connection to the R engine.
      Returns:
      R variable name which contains the data.
    • storeMeasurementsInRVector

      public static String storeMeasurementsInRVector(SensorAndMeasurements measurements, int sensorNumber, RReport.TimeseriesData dataSelection, REngineHelper.TransferType transferType, RConnection rConnection)
      Export the measurements of a sensor to R. There are two alternatives. The measurements can be transferred via an array, which implies certain size restrictions. An alternative is to use a temporary file. The behavior can only be switched in source code by the constant TRANSFER_TYPE. Variable names in R are as follows:
      For timespan data: "sensor" + #
      For eventtime data: "sensor" + # + "_ET")
      Parameters:
      measurements - Measurements for a sensor.
      sensorNumber - number of the sensor vector in R.
      dataSelection - the data element to save.
      rConnection - Connection to the R engine.
      Returns:
      R variable name which contains the data.