I've the following vector
x <- c("June 25, 2021","July 2, 2021","July 9, 2021", "July 16, 2021", "July 23, 2021", "July 30, 2021", "August 20, 2021",
"September 17, 2021", "October 15, 2021", "November 19, 2021", "December 17, 2021", "January 21, 2022", "June 17, 2022",
"September 16, 2022", "January 20, 2023", "March 17, 2023", "June 16, 2023")
Then, I need to convert it from character into dates. I tried
expiries <- as.Date(x, format = "%b %d, %Y")
but the result is
class(expiries)
[1] "Date"
expiries
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
Do you have any suggestion to get dates and not NAs?
My final aim is to calculate the difference between the values in expiries and another date set as the starting point.