How do I change my dates to the first day of the month...so 3/31/19 becomes 3/1/19, 2/28/19 becomes 2/1/19, and so on.
Thanks
How do I change my dates to the first day of the month...so 3/31/19 becomes 3/1/19, 2/28/19 becomes 2/1/19, and so on.
Thanks
One of the many ways to do it is to use lubridate
package.
library(lubridate)
date <- dmy('11/02/2019')
day(date) <- 1
date