如何在R中将日期从d/m/y转换为y-m-d
我有一个数据集,其中包含日期列,格式为30/12/2020。我需要做的是使用R脚本将其转换为2020-12-30格式使用lubridate如何在R中将日期从d/m/y转换为y-m-d,r,scripting,R,Scripting,我有一个数据集,其中包含日期列,格式为30/12/2020。我需要做的是使用R脚本将其转换为2020-12-30格式使用lubridate library(lubridate) df1$dates <- dmy(df1$dates) 使用lubridate library(lubridate) df1$dates <- dmy(df1$dates)
library(lubridate)
df1$dates <- dmy(df1$dates)
使用
lubridate
library(lubridate)
df1$dates <- dmy(df1$dates)