Calculates the product for each row (column) in a matrix.
product(x, idxs = NULL, na.rm = FALSE, ...)rowProds(x, rows = NULL, cols = NULL, na.rm = FALSE,
method = c("direct", "expSumLog"), ...)
colProds(x, rows = NULL, cols = NULL, na.rm = FALSE,
method = c("direct", "expSumLog"), ...)
If TRUE
, missing values are
ignored, otherwise not.
Not used.
A character
string specifying how each
product is calculated.
If method = "expSumLog"
, then then product
() function is
used, which calculates the produce via the logarithmic transform (treating
negative values specially). This improves the precision and lowers the risk
for numeric overflow. If method = "direct"
, the direct product is
calculated via the prod
() function.