Skip to content

Commit 472bfb0

Browse files
committed
Vignette: multi-arg reductions join logicals as integer, unlike c()
The shared table row said "join of all argument types" for both; that is exact for c() but understated min/max/sum/prod, which follow R in treating logical arguments as integers (sum(TRUE, TRUE) is 2L). Split the row. Review finding (fable-final-review.md #7).
1 parent b697fc3 commit 472bfb0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

vignettes/quickr-semantics.Rmd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ quickr then matches:
6363
| `%%`, `%/%` | join of the operand types; logicals count as integers |
6464
| `<` `<=` `>` `>=` `==` `!=` | logical |
6565
| `&`, `|`, `!`, `&&`, `||` | logical (see [logical operators](#logical-operators) below) |
66-
| `c()`, and multi-argument `min()` / `max()` / `sum()` / `prod()` | join of all argument types |
66+
| `c()` | join of all argument types (`c(TRUE, FALSE)` stays logical, as in R) |
67+
| multi-argument `min()` / `max()` / `sum()` / `prod()` | join of all argument types; logicals count as integers (in R, `sum(TRUE, TRUE)` is `2L`) |
6768
| single-argument reductions (`sum(x)`, ...), `abs()` | type of `x`; logical counts as integer |
6869
| `ifelse(test, yes, no)` | join of `yes` and `no` (but see [ifelse](#ifelse) below) |
6970
| `%*%`, `crossprod()`, `solve()`, and other linear algebra | always double, as in R; complex operands are a compile error (see [complex values](#complex)) |

0 commit comments

Comments
 (0)