Following is an example of the column of the data frame
time |
---|
00:01:47 |
01:05:45 |
17:10:00 |
20,551,697 more rows
The data type is character
The data is from Citi Bikes New York for the period January 2019 to December 2019
Note: the data that starts with JC is for New Jersey not New York City
Since the data is very large you can download just one months data to try the code:
The column time is not a part of the original data frame and was created by me using the following code:
ridedata_clean$time <- format(as.POSIXct(ridedata_clean$starttime),format = "%H:%M:%S")
Then I tried to change the format from chr to time or date time, using the follwoing code:
ridedata_clean$time <- format(ridedata_clean$time, format ="%H:%M")
But glimpse() still shows the data type as so I used strptime(), but it still did'nt change the format
ridedata_clean$time <- strptime(ridedata_clean$time, "%H:%M:%S")
I have tried to use the round function, but it didn't work:
round(ridedata_clean$time, units = "hours")
The I tried lubridate, but it didn't work, the code below maybe wrong since I am typing from memory as I was unbale to save this change:
round_date(ridedata_clean$time, "%H,%M,%S")
I am new to data analysis and this is my second project, please help.