Description Usage Arguments Details
View source: R/result_interpretation.R
Given a set of scatterpoints, remove those points that does not lead to an improvement in the accuracy of a plot. For now this is just if you take three points, and all their y values are identical, then remove the middle point. Identical is tested by ensuring that the absolute difference is below a tolerance parameter called min_delta.
1 | reduce_x_points(x, y, min_delta = 1e-04, max_length = 14)
|
min_delta |
The smallest increase in y that is required before it is flagged as a real change that is worth keeping. |
max_length |
The max length that an interval between two points on the x-axis will be allowed to grow to. If an interval is longer than this, then no other intervals will be to appended to it anymore. |
TODO: If three points lie on the same line, then the middle point adds no information. Expand this function to test this instead of just checking that the y values are the same. How will this affect the aggregated function? First implement that before considering making this improvement.
NOTE: This algorithm can be further improved. If any of three points do not share the same y value, all three points will be kept. Usually, only two needs to be kept. This will result in a minor improvement that is not worth the effort at present.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.