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")
Hope this helps!