I have two data frames with time data every 15 minutes but one starts precisely on time (0:00, 0:15, 0:30, 0:45, etc.) and one starts slightly off (0:03, 0:18, 0:33, 0:48, etc). I would like to round the slightly off one to the nearest 15 minutes interval so that I may later merge the data frames so that the data corresponding to those times are in the same rows. The data is in 24 hour time and, as an example, in the format of:
Time
0:00
0:15
0:30
0:45
1:00
I have tried the code below but r returns the error:
library(lubridate)
p_data <- read.csv("Filter12.csv", header = TRUE)
p_data$Time <- round_date(p_data$Time, "15 mins")
Error in UseMethod("reclass_date", orig) :
no applicable method for 'reclass_date' applied to an object of class "character"
In addition: Warning message: All formats failed to parse. No formats found.
I then tried converting the time column from character to numeric but recieved the error:
p_data$Time <- as.numeric(p_data$Time)
Warning message:
NAs introduced by coercion
I am very new to r (just started learning this week) so I apologize if this is due to a lack of common knowledge.