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

From: Fabio Sanchez <Fabio.Sanchez_at_ki.se>
Date: Thu 19 Oct 2006 - 11:49:12 GMT

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 Sánchez, MD, MSc, PhD
Molecular Dermatology
Department of Medicine
Karolinska Institute
SE-17176 Karolinska University Hospital
Tel: +46 8 51772158

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Oct 20 07:45:04 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 20 Oct 2006 - 05:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.