Displaying 3 results from an estimated 3 matches for "r_narmsymbol".
Did you mean:
r_namesymbol
2004 Nov 20
1
sum and partial argument name matching
"sum" (and perhaps other functions?) allows partial argument
name matching after its three-dots argument:
> sum(1:4, NA, n=78, na.rm=FALSE)
[1] 10
> sum(1:4, NA, n=78, na.rm=TRUE)
[1] 11
I can see there could be a discussion about whether or not this is
a bug, but I think all will agree that it's a might peculiar.
This is done in 2.0.1 but the same behavior is in 1.8.1.
2023 Apr 14
0
sum(), min(), max(), prod() vs. named arguments in ...
...te_hidden
SEXP fixup_NaRm(SEXP args)
{
+ Rboolean seen_NaRm = FALSE;
SEXP t, na_value;
/* Need to make sure na.rm is last and exists */
@@ -415,7 +416,9 @@
na_value = ScalarLogical(FALSE);
for(SEXP a = args, prev = R_NilValue; a != R_NilValue; a = CDR(a)) {
if(TAG(a) == R_NaRmSymbol) {
+ if(seen_NaRm) error("Please specify na.rm only once");
+ seen_NaRm = TRUE;
if(CDR(a) == R_NilValue) return args;
na_value = CAR(a);
if(prev == R_NilValue) args = CDR(a);
else SETCDR(prev, CDR(a));
(Can we use error(_("formal argument \"%s\&q...
2023 Apr 16
0
sum(), min(), max(), prod() vs. named arguments in ...
...+ Rboolean seen_NaRm = FALSE;
> SEXP t, na_value;
>
> /* Need to make sure na.rm is last and exists */
> @@ -415,7 +416,9 @@
> na_value = ScalarLogical(FALSE);
> for(SEXP a = args, prev = R_NilValue; a != R_NilValue; a = CDR(a)) {
> if(TAG(a) == R_NaRmSymbol) {
> + if(seen_NaRm) error("Please specify na.rm only once");
> + seen_NaRm = TRUE;
> if(CDR(a) == R_NilValue) return args;
> na_value = CAR(a);
> if(prev == R_NilValue) args = CDR(a);
> else SETCDR(prev, CDR(a));
>
> (Can we us...