Currently I'm working on Divvy dataset Google capstone project. I am a novice in this field.
This Dataset contains data about the ride. I have combined 12 files of previous year to make a huge dataset.
Masterfile <- read.csv('Masterfile.csv')
I'm struggling to form a new column 'ride_length' which i can get by subtracting data of column "Started_at" and "Ended_it".
These columns contains date "02-07-21 14:44" and "02-07-21 15:19" in this format.
I even converted both the columns in Numeric.
***Masterfile$ended_at <- as.numeric(Masterfile$ended_at, origin = "02-07-21 15:19")
Masterfile$started_at <- as.numeric(Masterfile$started_at , origin = "02-07-21 14:44") ***
When i Didn't supply origin I was getting this error-
"Error in as.POSIXct.numeric(time1) : 'origin' must be supplied"
But when I did , I got the following error-
Error in difftime(Masterfile$ended_at, Masterfile$ended_at, origin = "02-07-21 15:19") :
I might be doing silly mistake kindly help me . I am just stuck.
But I am unable to do it.