![](/img/trans.png)
[英]How to convert week and year columns to a date column with lubridate in R
[英]How to convert a Date column with lubridate and keep it within the dataframe?
目前,我正在嘗試將存儲為字符類型的日期列更改為日期類型。 我成功地能夠使用 lubridate 進行此更改。 但是,它消除了我的數據框,只將新日期保留為值。
如何保留數據框中的所有內容?
您正在使用新創建的日期列的值覆蓋整個數據框。
而是做
dc.crime.complete$Date <- ymd(dc.crime.complete$Date)
這將用新值覆蓋您的日期列。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.