What is the class of your data? If your data is called df
check class(df$column_name)
. If it is of class POSIXct
you can do :
df$new_column <- df$column_name - 30*60
Or with lubridate
:
df$new_column <- df$column_name - lubridate::minutes(30)
If the class is something different than POSIXct
(eg - character) you need to first change it to POSIXct
class before using the answer above. That can be done with
df$column_name <- as.POSIXct(df$column_name, tz = 'UTC')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…