[R] Weird Behavior of mean

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Fri Dec 13 21:22:12 CET 2024


This was documented in [1] forever ago. I would not miss it if a future version of R chose to remove those variables.

[1] The R Inferno, 8.1.32

On December 13, 2024 11:21:13 AM PST, ivo welch <ivo.welch using ucla.edu> wrote:
>isn't this still a little R buglet?  I have overwritten T (even if my
>schuld [franconian], it is not that uncommon an error, because T is also a
>common abbreviation for the end of a time series; namespace pollution in R
>can be quite annoying, even though I understand that it is convenient in
>interactive mode).  Nevertheless, I am passing into mean() a positive
>number for na.rm, and by definition, a positive number still means TRUE.
> besides, sd() and mean() should probably treat this similarly, anyway.  I
>do see the argument that functions cannot be proof against redefinitions of
>all sorts of objects that they can use.    more philosophically, some
>variables should not be overwritable, or at least trigger a warning.
>
>As Dante wrote, Abandon all hope ye who enter R.
>
>--
>Ivo Welch (ivo.welch using ucla.edu)
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using 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.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list