[R] Help!!!!!

anoumou teko_maurice at yahoo.fr
Sat Nov 24 15:39:18 CET 2012


Dear R users.
I am little lost and i need your  help.
I have such data.
DATE                   i Symptomes     t
1   2009-04-24             Mexique         0 14358
2   2009-04-24                 usa         0 14358
3   2009-04-26             Mexique        18 14360
4   2009-04-26                 usa       100 14360
5   2009-04-27              Canada         6 14361
6   2009-04-27             Mexique        26 14361
7   2009-04-27               Spain         1 14361
8   2009-04-27                 usa        40 14361
9   2009-04-28             Canada          6 14362
10  2009-04-28             Israel          2 14362
11  2009-04-28             Mexique        26 14362
12  2009-04-28       New Zealand           3 14362
13  2009-04-28              Spain          2 14362
14  2009-04-28     United Kingdom          2 14362
15  2009-04-28                 usa        64 14362
16  2009-04-29             Canada         13 14363
17  2009-04-29            Austria          1 14363
18  2009-04-29             Germany         3 14363
19  2009-04-29             Israel          2 14363
20  2009-04-29             Mexique        26 14363
21  2009-04-29       New Zealand           3 14363
22  2009-04-29               SPAIN         4 14363
23  2009-04-29     United Kingdom          5 14363
A data with a date in character format,i wich reprent a country,Symptomes
wich is a number of subjects having a disease,t the date convert in numeric.
I want to create two other variables (for example INCUBATION and CONTAGIEUX)
Incubation[ i ] add values for symptomes for the two previous days (for
t<=t-1)

CONTAGIEUX [ i ] add values for symptomes for the 7 next days (for t>=t+6).
I want the two variables INCUBATION and CONTAGIEUX to be cumulative for next
and previous date.

For example for 

date           i           Symptomes   Incubation     CONTAGIEUX
2009-04-24     Mexique       0            18+0               0

2009-04-26     Mexique       18           18+26           18+0

2009-04-27     MEXIQUE       26           18+26+...       18+26...
Thanks.




--
View this message in context: http://r.789695.n4.nabble.com/Help-tp4650647.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list