[問題] R 請教density指令

看板Statistics作者時間16年前 (2009/07/04 20:34), 編輯推噓0(002)
留言2則, 2人參與, 最新討論串1/1
請教各位前輩: rabbit為資料集 b1為資料集裡的變項:收入 指令如下: kwidth <- 0.2597 dens1 <- density(rabbit$b1, n = 23788, width=kwidth) R給的錯誤訊息為: 錯誤在density.default(rabbit$b1, n = 23788, width = kwidth) :    argument 'x' must be numeric 請問應該怎麼修正,R所指的"x",才能變成數字的型態? 或者是我的指令整個有錯? 謝謝各位前輩!! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.68.127.30

07/04 20:37, , 1F
as.numeric(rabbit$b1)
07/04 20:37, 1F

07/04 20:52, , 2F
謝謝smallpudding!!我試試看~~
07/04 20:52, 2F
※ 編輯: crabstick 來自: 203.68.127.30 (07/04 22:19) ※ 編輯: crabstick 來自: 203.68.127.30 (07/04 22:20) ※ 編輯: crabstick 來自: 203.68.127.30 (07/04 22:21) ※ 編輯: crabstick 來自: 203.68.127.30 (07/07 19:17)
文章代碼(AID): #1AJqn7NV (Statistics)