Hey all I apologise if this is very simple and mediocre but I can't seem to create a function that turns a time variable (00:00:00) into a numeric AND creates a new column to put the result in.
I can turn the time into a numeric, I just cannot complete the 'new column' part. Any help is appreciated.
Time <- function(x) {
begin <- x$avg..wait.time
x$Num.wait.time <- as.numeric(as.POSIXct(strptime(begin, "%H:%M:%S")))
}
(NOTE: avg..wait.time
is the time cell and
Num.wait.time
is the new variable/column I want to create)