-3

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

Nik
  • 51
  • 1
  • 5

1 Answers1

1

One of the many ways to do it is to use lubridate package.

library(lubridate)
date <- dmy('11/02/2019')
day(date) <- 1
date
markus
  • 25,843
  • 5
  • 39
  • 58
Adamik Ewert
  • 119
  • 1
  • 10