Bugzilla – Bug 14864
[PATCH] (5 lines) plot.stepfun ignores documented xval argument
Last modified: 2012-03-29 14:07:36 UTC
Created attachment 1283 [details]
5 line patch to get this function to use the xval argument. No change when xval not specified.
Ran into this bug on R 2.14.2 on Linux today, but it appears to be universal and to have existed since plot.stepfun was first imported to its current location in the stats library in 2003.
which calls :
?plot.stepfun indicates that xval can be used to specify a numeric vector of abscissa values at which to evaluate ‘x’. However, the implementation ignores it for this purpose and always evaluates x at knots(x).
The attached 5-line patch has no effect in the default codepath where xval is not specified, but it now allows xval to be used as documented.
This came up as problematic for me when creating ecdfs of very large datasets and generating PDFs for a report. The resulting files were 15MB+ for a simple CDF, because far more detail was included than the eye could perceive. The xval argument now lets me set a more reasonable default and greatly reduce the size of generated vector plots.
Changed for 2.15.0 patched.