I'm using MonetDB and embedded R with a huge amount of accelerometer sensor data. I created an aggregate function which calculates a Fast Fourier Transformation on the sensor data and extracts a single value.
CREATE AGGREGATE fft_max_s(val double) RETURNS DOUBLE LANGUAGE R{
sapply(split(val,aggr_group), FUN = function(d){
max(Mod(fft(d)))
})
};
My question: Is it possible to let this aggregate function create multiple values?