Skip to content

Missing and number of days

2 messages · Val, R Help

#
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: