Description Usage Arguments Details Value Missing values Author(s)
Calculates the product for each row (column) in a matrix.
1 2 3 |
x |
A |
na.rm |
If |
method |
A |
... |
Not used. |
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.
Returns a numeric
vector
of length N (K).
Note, if method="expSumLog"
, na.rm=FALSE
, and x
contains missing values (NA
or NaN
), then the calculated value
is also missing value.
Note that it depends on platform whether NaN
or NA
is returned
when an NaN
exists, cf. is.nan
().
Henrik Bengtsson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.