Displaying 1 result from an estimated 1 matches for "get_significant_rows_1".
2011 Oct 17
1
compressing/reducing data for plot
...ery slow! (Takes about 4 seconds for each 1e5 element
dataframe)
* It does not work well if the values increase/decrease monotonically
with small values - it will remove them all since the difference between
each point and its predecessor is minimal
I included my own function below:
=== cut ===
get_significant_rows_1 <- function (data, threshold) {
# get the difference between each datapoint and the following datapoint
# of course this list is one shorter than the input dataset, which does
# not matter since the first and last datapoint will always be included
diffs = abs(data[1:nrow(data)-1,] - data[2:nrow...