[R] Writing a script for multiplying a progressively larger lists of items

Fabio Sanchez Fabio.Sanchez at ki.se
Thu Oct 19 13:49:12 CEST 2006


Hi, I would like to get guidance as to how to write code in R that can 
deal with the following situation:

v1 is a vector containing a sequence of numbers (Ex. 1:10)
I want to store the sequence of numbers resulting from multiplying the 
first and the second element in the vector, then the product of the 
1st, 2nd and 3rd, then 1st,2nd,3rd and 4th and so forth until all the 
elements in the vector are multiplied.

Many thanks,

Fabio


Fabio Sánchez, MD, MSc, PhD
Molecular Dermatology
Department of Medicine
Karolinska Institute
SE-17176 Karolinska University Hospital
Tel: +46 8 51772158



More information about the R-help mailing list