Calculates the product for each row (column) in a matrix
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 method = "expSumLog"
, then then product
() function is
used, which calculates the product 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.
Henrik Bengtsson
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.