0

I am in R studio trying to separate my dates "6/30/22 17:27" into year, month, day, and hms columns. The problem is it's not a numeric type variable, it's a character type. So I need to convert it before I can separate it into my needed columns.

So I tried using

#convert dates from characters to dates
all_trips$date <- as.Date(all_trips$started_at)

but I only got this error message

Error in charToDate(x) : 
  character string is not in a standard unambiguous format

so I tried converting to a numeric using as.numeric but only got this

Warning message:
NAs introduced by coercion 

it only came back as null values.

I tried using the lubridate package to see if I could convert them to mdy_hm but that onyl came back as

Warning message:
 3485127 failed to parse. 

I'm not quite sure what I can do at this point.

1 Answers1

0

this apparently works...

all_trips$date <- mdy_hm(all_trips$started_at)

... I don't understand what changed but here we are.