I want to calculate the number of months between two dates but before that I have a problem when loading the data in r. In csv sheet the format is mm/dd/yyyy
but in R the variable is classified as character.
I tried
data$issue_d <- format(as.Date(data$issue_d), "%m/%d/%Y")
and to convert as date first but it gives the following error
character string is not in a standard unambiguous format
Any suggestion for this?
Example input:
issue_d <- c("Dec,2011","Nov,2014","Apr,2015")
data$issue_d <- as.Date(data$issue_d, format = "%m/%d/%Y")
– zx8754