简体   繁体   English

将 integer 列转换为最新

[英]Transform integer column to date

I have a column in format 19990101 that I would like to change to date format.我有一个格式为 19990101 的列,我想将其更改为日期格式。 It is currently as integer.目前为 integer。

I've tried the following but it results in我尝试了以下方法,但结果是

Error: unexpected symbol in: mutate(Date = Date, Date = as.integer(format)date.错误:出现意外符号:mutate(Date = Date, Date = as.integer(format)date。

mutate(Date = Date,
       Date = as.integer(format)date, "%Y%m%d")
mutate(Date = Date,
       Date = as.Date(format(x), "%Y%m%d")

The above code solved my issue.上面的代码解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM