[R] macro function

mrzung mrzung46 at gmail.com
Tue Feb 28 14:35:31 CET 2012


Actually, what I really want to do is that,

                                                                            
<<"annual productivity data(2011)">>

       firts date                  2011-01-01                 2011-01-02                 
2011-01-03                  2011-01-04                  2011-01-05      * *
*
A    2011-02-03                       0                                    
0                                     0                                    
0                                      0             * * *
B    2011-01-02                       0                                   
10                                   11                                   12                                  
13            * * *
C    2011-04-02                       0                                    0                                  
11                                   12                                   13              
* * *
D    2011-02-02                       0                                    
0                                     0                                    
0                                      0               * * *
E    2011-11-02                        0                                    
0                                     0                                    
0                                      0              * * *
        *
        *
        *

I have this "annual productivity data(2011)" and I need to convert this as
"D-Day data". That is to say,  I need this form.

     firts date                       D-DAY                            D+1                               
D+2                                  D+3                                D+4     
* * *
A   2011-02-03                       0                                     0                                    
0                                     0                                     
0             * * *
B   2011-01-02                       0                                    10                                  
11                                   12                                   13           
* * *
C   2011-04-02                       0                                    0                                  
11                                   12                                   13              
* * *
D   2011-02-02                       0                                     0                                    
0                                     0                                     
0               * * *
E   2011-11-02                        0                                    
0                                     0                                    
0                                      0              * * *
  
        *
        *
        *

D-day is the "first date" and each cells are day-productivity of the day.

how can I make a code for that?

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



More information about the R-help mailing list