rowProds(x, na.rm=FALSE, method=c("expSumLog", "direct"), ...)
colProds(x, na.rm=FALSE, method=c("expSumLog", "direct"), ...)
product(x, na.rm=FALSE, ...)TRUE, missing values are ignored, otherwise not.character string specifying how each product
is calculated.method="expSumLog" and na.rm=FALSE, then
results returns NA regardless of whether there were only NaN
but no NA in the first place, e.g. product(NaN) returns NA
and product(c(NA, NaN)) returns NA.
This is contrary to prod(), which can distinguish between
the two, e.g. prod(NaN) returns NaN and
prod(c(NA, NaN)) returns NA.
The reason for this discrepancy is that it is not possible for
product() to be consistent with prod() in this sense
without major performance penalities.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.