Skip to content
Prev 201753 / 398506 Next

Missing and number of days

For your first question, I believe that

dat[dat==-9]=NA

should do the trick

For your second, are you dates in the Date() format?  If not, try ?Date

Once you get them in Date format, then you can simply subtract them
 d1 = as.Date('20090604',format="%Y%m%d")
d2 = as.Date('20080604',format="%Y%m%d")
d1-d2
Time difference of 365 days
On Thu, Nov 26, 2009 at 12:30 PM, Val <valkremk at gmail.com> wrote: