I've downloaded some FRED data (ICSA) using quantmod and I'm trying to
align it with weekly GSPC data. I'm running into trouble because the ICSA
data seems to come out on Saturdays and weekly closes of GSPC are usually
on Friday. I tried a simple fix of subtracting 1 from the ICSA dates but I
still run into problems around holidays.  For example, the market was
closed on April 6, 2012 so I can't align the data for that week.

Any suggestions how I get the dates lined up so I can do some further
analysis ?  I know I could use a brute force method of doing a simple cbind
(combined <-cbind(sp,ICSA[,1]))  instead of merge but wondering if there's
a better way that takes holidays into account.

require(quantmod)
getSymbols('ICSA', src='FRED')
getSymbols('^GSPC', from='1967-01-01', to=Sys.Date())
index(ICSA) <-index(ICSA)-1
sp <-to.weekly(GSPC)[,6]
names(sp) <-'GSPC'
combined <-merge(ICSA,sp)
tail(combined, 15)


            ICSA    GSPC
2012-03-30 362000 1408.47
2012-04-05     NA 1398.08
2012-04-06 388000      NA
2012-04-13 389000 1370.26
2012-04-20 392000 1378.53
2012-04-27 368000 1403.36
2012-05-04 370000 1369.10
2012-05-11 372000 1353.39
2012-05-18 373000 1295.22
2012-05-25 389000 1317.82
2012-06-01 380000 1278.04
2012-06-08 389000 1325.66
2012-06-15 392000 1342.84
2012-06-22 386000 1335.02

	[[alternative HTML version deleted]]

