Пакет lubridate
облегчает:
library(lubridate)
library(dplyr)
df %>%
mutate(NewDate = lubridate::mdy_hms(paste(Date, Time))) %>%
select(NewDate, Price)
NewDate Price
1 2018-05-03 09:00:00 125.9
2 2018-05-03 09:00:00 125.9
3 2018-05-03 09:00:00 125.9
4 2018-05-03 09:00:00 125.9
5 2018-05-03 09:00:00 125.9
Данные:
df <- structure(list(Date = c("05/03/2018", "05/03/2018", "05/03/2018",
"05/03/2018", "05/03/2018"), Time = c("09:00:00am", "09:00:00am",
"09:00:00am", "09:00:00am", "09:00:00am"), Price = c(125.9, 125.9,
125.9, 125.9, 125.9)), class = "data.frame", row.names = c(NA,
-5L))