[問題] 關於by()
[軟體熟悉度]:
入門(寫過其他程式,只是對語法不熟悉)
[問題敘述]:
問題一:
照著R in Action第134頁執行下列程式碼時,會出現錯誤訊息。
vars <- mtcars[c("mpg","hp","wt")]
dstats <- function(x)(c(mean=mean(x),sd=sd(x)))
by(mtcars[vars],mtcars$am,dstats)
>>> Error in is.data.frame(x):
(list) object cannot coerced to type 'double'
In addition:Warning message:
In mean.default(x):argument is not numeric or logical:returning NA
問題二:
設定常用package時,在WIN8按下SAVE存檔時,會發生存取被拒的訊息(WIN7不會)
C:\Program Files\R\R-3.1.2\etc\Rprofile.site
.First=function()
{
library(reshape)
...
}
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.243.62.198
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1444547145.A.B3D.html
討論串 (同標題文章)
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章