All Downloads are FREE. Search and download functionalities are using the official Maven repository.

timeBench.R.RAggregationFunction Maven / Gradle / Ivy

Go to download

TimeBench, a flexible, easy-to-use, and reusable software library written in Java that provides foundational data structures and algorithms for time- oriented data in Visual Analytics.

The newest version!
package timeBench.R;

import org.rosuda.REngine.REXPMismatchException;
import org.rosuda.REngine.REngine;
import org.rosuda.REngine.REngineException;

import timeBench.action.analytical.GranularityAggregationFunction;
import timeBench.data.TemporalObject;

public class RAggregationFunction extends GranularityAggregationFunction {
	String rAggregationFunction = "mean";
	REngine engine;
	boolean ignoreMissings = false;
	
	public RAggregationFunction(REngine eng) {
		engine = eng;
	}
	
	public RAggregationFunction(REngine eng, String fct) {
		engine = eng;
		rAggregationFunction = fct;
	}
	
	public RAggregationFunction(REngine eng, String fct, boolean ignoreMissings) {
		engine = eng;
		rAggregationFunction = fct;
		this.ignoreMissings = ignoreMissings;
	}
	
	public RAggregationFunction(REngine eng, boolean ignoreMissings) {
		engine = eng;
		this.ignoreMissings = ignoreMissings;
	}

	@Override
	public double[] aggregate(Iterable childs,
			int[] dataColumnIndices, Double missingValueIdentifier) {
		String data = "c(";
		int childcount = 0;
		double[] firstvalues = new double[dataColumnIndices.length]; 
		for(int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy