Может быть, это может помочь:
# some fake data
df <- data.frame(a = 1, timestamp = '2018-11-11 12:13:14')
# convert as data
library(lubridate)
df$timestamp <- ymd_hms(as.character(df$timestamp, tz = "UTC"))
# add the hour:minutes column
library(dplyr)
df %>% mutate(hour_ = format(df$timestamp,'%H:%M'))
a timestamp hour_
1 1 2018-11-11 12:13:14 12:13
Или только в одной dplyr
цепочке:
df %>%
mutate(hour_ = format(ymd_hms(as.character(df$timestamp, tz = "UTC")),'%H:%M'))