[程式] R: 如何把年跟英文月份合成一個日期欄位

看板Statistics作者 (chu)時間1年前 (2022/05/10 01:44), 編輯推噓2(203)
留言5則, 4人參與, 1年前最新討論串1/1
請問一下 我有兩個欄位分別是年跟英文月份, 像這樣: https://imgbox.com/4NvGZjj1 我要如何用R把這兩個欄位合成一個日期欄位 謝謝~~ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 129.174.182.118 (美國) ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1652118253.A.39B.html

05/10 09:08, 1年前 , 1F
mutate(X, Date=paste(Year,Month))
05/10 09:08, 1F

05/10 17:25, 1年前 , 2F

05/10 18:04, 1年前 , 3F
with(x, as.Date(paste(Year, Month, 1), "%Y %b %d"))
05/10 18:04, 3F

05/10 18:05, 1年前 , 4F
with改within可回傳整個dataframe
05/10 18:05, 4F

05/11 04:11, 1年前 , 5F
感謝!!!!!
05/11 04:11, 5F
文章代碼(AID): #1YULBjER (Statistics)