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
Also one line using format function:
format(Sys.Date(),"01-%m-%Y")
[1] "01-06-2017"