Take a look in prod function:
prod(1:4)
On Thu, Jan 20, 2011 at 3:18 PM, Jannis wrote:
> Dear list,
>
>
> is there a function in R that returns the product of a vector?
>
> E.g. if the vector is c(1,2,3,4) it should return 1*2*3*4=24
>
>
> Cheers
> Jannis
>
>
>
>
>
>
> _
Is this what you want:
> prod(c(1,2,3,4))
[1] 24
>
On Thu, Jan 20, 2011 at 12:18 PM, Jannis wrote:
> Dear list,
>
>
> is there a function in R that returns the product of a vector?
>
> E.g. if the vector is c(1,2,3,4) it should return 1*2*3*4=24
>
>
> Cheers
> Jannis
>
>
>
>
>
>
> _
Dear list,
is there a function in R that returns the product of a vector?
E.g. if the vector is c(1,2,3,4) it should return 1*2*3*4=24
Cheers
Jannis
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do re
3 matches
Mail list logo