Change day of the month in a Date to first day (01)

Yes, there is a one-liner for that using function cut:

cut(Sys.Date(), "month")
[1] 2012-11-01
Levels: 2012-11-01

Leave a Comment