我从Excel导入了一些数据,这些数据具有“日期”和“时间”的单独列。当我导入“时间”列时,它为每个单个时间值返回1899-12-31 19:00:00
,并带有日期1899-12-31
。
我想创建一个新列,该列将合并“日期”列中的日期和“时间”列中的时间,以便进行一些计算。
# A tibble: 207 x 2
DoS ToS
<dttm> <dttm>
1 2018-01-27 00:00:00 1899-12-31 19:00:00
2 2018-02-07 00:00:00 1899-12-31 15:45:00
3 2018-02-13 00:00:00 1899-12-31 23:00:00
4 2018-02-15 00:00:00 1899-12-31 13:45:00
5 2018-02-16 00:00:00 1899-12-31 10:00:00
6 2018-02-19 00:00:00 1899-12-31 15:00:00
7 2018-02-20 00:00:00 1899-12-31 15:05:00
8 2018-02-21 00:00:00 1899-12-31 15:00:00
> dput(head(sample,10))
structure(list(DoS = structure(c(1517011200,1517961600,1518480000,1518652800,1518739200,1518998400,1519084800,1519171200,1519257600,1519862400),class = c("POSIXct","POSIXt"),tzone = "UTC"),ToS = structure(c(-2209006800,-2209018500,-2208992400,-2209025700,-2209039200,-2209021200,-2209020900,-2209033800,-2209005000),tzone = "UTC")),class = c("tbl_df","tbl","data.frame"),row.names = c(NA,-10L))
有什么方法可以提取时间值并将其粘贴到“日期”列中?