Displaying 2 results from an estimated 2 matches for "fixup_narm".
2023 Apr 14
0
sum(), min(), max(), prod() vs. named arguments in ...
...he last specified value is silently taken
into account.
Most of this behaviour is exactly as documented, but it's arguably a
source of mistakes when the na.rm=TRUE argument is mistyped and
converted to 1.
Internally, all these calls land in do_summary(), and the na.rm
argument is processed by fixup_NaRm(). mean() is safe because it's
dispatched via S3 lookup.
Do users normally name their arguments to sum()? If not, it could be
relatively safe to make it a warning to pass named arguments to sum()
that are not na.rm and later transition it to an error:
--- src/main/summary.c (revision 84252)
+...
2023 Apr 16
0
sum(), min(), max(), prod() vs. named arguments in ...
...n
> into account.
>
> Most of this behaviour is exactly as documented, but it's arguably a
> source of mistakes when the na.rm=TRUE argument is mistyped and
> converted to 1.
>
> Internally, all these calls land in do_summary(), and the na.rm
> argument is processed by fixup_NaRm(). mean() is safe because it's
> dispatched via S3 lookup.
>
> Do users normally name their arguments to sum()? If not, it could be
> relatively safe to make it a warning to pass named arguments to sum()
> that are not na.rm and later transition it to an error:
>
Forbidding...