且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将列从军事时间转换为标准时间

更新时间:2023-02-06 17:09:46

根据您的标准 - 322表示为3,2045为20 - 如何除以100然后用 trunc()向0舍入。

Given your criteria -- that 322 is represented as 3 and 2045 is 20 -- how about dividing by 100 and then rounding towards 0 with trunc().

 time_24hr <- c(1404, 322, 1945, 1005, 945)
 trunc(time_24hr / 100)