開始使用免費開始

使用 lubridate 的 as_date

把資料轉成正確的類別是很重要的 R 技能。現在你要把 weekends 物件轉成 Date 類別,並使用 lubridate 來完成。

lubridate 套件與 weekends 物件都已為你載入!

本練習屬於課程

在 R 中操作時間序列資料

檢視課程

練習說明

  • 使用 lubridateweekends 轉為 Date 類別,並指定給 weekends_date
  • 在主控台列印 weekends_date 的摘要。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Convert weekends to Date class with lubridate
___

# Print a summary of weekends_date
___
編輯並執行程式碼