作者genki358 (Dark Joker)
看板R_Language
标题[问题] 关於by()
时间Sun Oct 11 15:05:43 2015
[软体熟悉度]:
入门(写过其他程式,只是对语法不熟悉)
[问题叙述]:
问题一:
照着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://webptt.com/cn.aspx?n=bbs/R_Language/M.1444547145.A.B3D.html