[R] strange behavior when adding a day to dates

markleeds at verizon.net markleeds at verizon.net
Thu Jun 1 21:01:01 CEST 2006


I have the following problem which seems really strange but it's more likely something that I don't understand ?

The code below works in that it adds 1 day to all of the dates.
( NB : the Fcalendar package needs to be loaded for this code to run )

startDate="1992-12-31"
endDate="1994-12-31"

begMonthDates=timeSequencestartDate,endDate,by="months,FinCenter="GMT") 

print(begMonthDates)
begMonthDates = begMonthDates + 24*3600
print(begMOnthDates)

------------------------------------------------------------------

Th really strange thing is that, in the code below, the
dates don't change ? The code is essentially the same
as above except in this case I only want to add one day to days
that are not business days ? If anyone could help me with this,
it would be MUCH appreciated. I've been playing with this for
most of the day. ( badindices is not NULL )


---------------------------------------------------------------------

badindices=which(isBizday(begMonthDates,holidays=holiday.NYSE()) == F)

print(begMonthDates[badindices])
begMonthDates[badindices]=begMonthDates[badindices] + 24*3600
print(begMonthDates[badindices])



More information about the R-help mailing list