## vectorisation: x *or* shift (but not both!)
end_of_month(as.Date("2013-01-15"), shift = c(-1, 0, 1))
end_of_month(as.Date("2013-01-15") + 0:100)
day_of_month(d <- as.Date("2013-01-22"))
day_of_month(d) <- 5
d
Run the code above in your browser using DataLab