【发布时间】:2021-12-29 18:35:15
【问题描述】:
离开日期列我想将数据框中的其余列从 chr 转换为数字。我怎么能做到这一点?数据框中有很多列,下面只是一个摘录。谢谢。
Date RECORD Battery_V Data_logger_Temp_C VWC_CS7
2021-06-25 12:34:00 0 12.47 14.14 0.127
【问题讨论】:
-
到目前为止有什么尝试?你知道
colnames(df)和例如for (col in colnames(df)) { # do something here ... }吗? -
我在 sapply 上试了一下,但没有给出想要的输出。
标签: r dplyr data-transform