On 2025-06-25 2:11 p.m., Dennis Fisher wrote:
Version 4.4.2
OS X

Colleagues

I often need to determine the span of the x-variable in a graphic.

This is easy to determine with:
        diff(range(VAR, na.rm=T))

I am not aware of any function in base R that accomplishes this and “span” is 
not taken.
Then you should write one that suits your needs. It could have just the line above, or you could make it fancier, expanding the range a bit like plot() does.


Would it be possible to add such a function?  Not a major addition but often 
useful.
If you think others would like to use it, then include it in a package and publish the package.

Duncan Murdoch

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to