I have a date in R, e.g.
dt = as.Date('2010/03/17');
The easiest thing to do is to convert it into POSIXlt and subtract 2 from the years slot.
> d <- as.POSIXlt(as.Date('2010/03/17')) > d$year <- d$year-2 > as.Date(d)  "2008-03-17"
See this related question: http://stackoverflow.com/questions/2254986/how-to-subtract-days-in-r.