I am trying to execute the following code chunk:
all_tripdata$date <- as.Date(all_tripdata$started_at)
The goal is to format date and aggregate ride data for each month, day, or year.
Instead, I got the following error message:
Error in charToDate(x) :
character string is not in a standard unambiguous format
Could someone please help me solve this probleme
What format is all_tripdata$started_at in? If it is not in yyyy-mm-dd format, then you have to specify its format in as.Date. For instance, if your date is in mm/dd/yy format, then converting it to date would involve the following:
date <- "2/11/22"
newdate <- as.Date(date,"%m/%d/%y")