rowProds {gRapHD} | R Documentation |
Form row products for numeric arrays.
rowProds(x,na.rm=TRUE)
x |
matrix. |
na.rm |
logical. Whether missing values (including NaN ) are
omitted from the calculations. |
Equivalent to use of apply with FUN = prod and MARGIN = 1, but is faster.
Vector with length nrow(x)
.
Gabriel Coelho Goncalves de Abreu (Gabriel.Abreu@agrsci.dk)
Rodrigo Labouriau (Rodrigo.Labouriau@agrsci.dk)
David Edwards (David.Edwards@agrsci.dk)
set.seed(1,kind="Mersenne-Twister") a <- matrix(rnorm(100),nrow=5) x <- rowProds(x=a, na.rm=TRUE) # x # [1] -3.359208e-07 -2.861043e-10 -2.831108e-08 -5.451996e-07 3.057436e-04