我正在使用纵梁来匹配游泳时间,但无法获得分钟,秒和小数秒的列输出的一致性。
string <- c("3:45.88","24.99")
time <- "[[\\s]+]?([\\d]+)\\:?([\\d]+)\\.([\\d]+)"
这是输出:
str_match(string,time)
[,1] [,2] [,3] [,4]
[1,] "3:45.88" "3" "45" "88"
[2,] "24.99" "2" "4" "99"
这是所希望的:
[,1] [,2] [,3] [,4]
[1,] "3:45.88" "3" "45" "88"
[2,] "24.99" "" "24" "99"
非常感谢您的指导。