s-news
[Top] [All Lists]

For loop

To: <s-news@lists.biostat.wustl.edu>, <s-news@wubios.wustl.edu>
Subject: For loop
From: "Bikash Jain" <bjain@bslindia.com>
Date: Mon, 9 Oct 2006 15:23:15 +0530
Reply-to: "Bikash Jain" <bjain@bslindia.com>
Hi,

I have generated 100 random numbers from the poisson distribution using the
following command :

rpois(100, 3)

[1] 1 2 4 5 3 2 4 4 3 4 3 7 4 2 3 6 2 3 3 8 5 2 4 6 1 2 3 6 5 3 3 4 5 0 3 1
6 1 1 8 0 0 1 3 5 4 3 2 2 2 2 7 2 2 4 5 5 5 4 3 2 1 3 3 5 1 3 3 2 5 2 4 5 3
3 9 2 4 1 3 4 3 3 2 3 3 1 2 1 5 4 3 6 2 3 1 1
[98] 3 3 3

I want to use the for loop to calculate the sum of first 12 numbers (i.e 1
to 12)  followed by the sum of another 12 numbers (13 to 25) and so on from
the above numbers generated. Please let me know the commands to write the
for loop for the same.

Thank you and Best Regards,

Bikash Jain
Manager-Technical
Binary Semantics Limited
Plot No. 38, Electronic City
Sector-18
Gurgaon-122015
Haryana, India

Phone : +91-124-2397660  Xtn: 239
Cell : 9818250173
Web : http://www.binarysemantics.com



<Prev in Thread] Current Thread [Next in Thread>