使用 lubridate 的 as_date
把資料轉成正確的類別是很重要的 R 技能。現在你要把 weekends 物件轉成 Date 類別,並使用 lubridate 來完成。
lubridate 套件與 weekends 物件都已為你載入!
本練習屬於課程
在 R 中操作時間序列資料
練習說明
- 使用
lubridate將weekends轉為Date類別,並指定給weekends_date。 - 在主控台列印
weekends_date的摘要。
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
# Convert weekends to Date class with lubridate
___
# Print a summary of weekends_date
___