最新回答 / Tenrai
class(tapply(x, f, mean))和class(tapply(x, f, mean,simplify = FALSE))這兩個應該是等價的吧,simplify = true時后面就是一個向量了。
2019-04-22
已采納回答 / 蒸包
大佬,你的代碼里dim(2,3,4)打成了dim(2,3.4)array usage里:dim the dim attribute for the array to be created, that is an integer vector of length one or more giving the maximal indices in each dimension.所以相當于as.integer(3.4) equals 3自然就是2行3列啦
2019-03-22
最新回答 / 冷蒞
先是v4中5個數升序排列,然后是v4中相同的值要分別升序排列,因為相同,所以選其它列為基準,視頻中選了v2整體總的是做的升序排列,v2也必須升序按你說的最后和直接按照v2降序沒有區別
2019-03-12
最新回答 / 麻辣棉花糖
tmpMeans <- function(x){? colMeans(x[,c("Ozone","Wind","Temp")])}sapply(s, tmpMeans)老師實際執行的是這個段代碼的簡寫,把函數定義直接寫在了sapply函數里。重新定義函數tmpMeans函數的意義在于,處理選擇“Ozone”,"Wind","Temp"篩選的問題。sapply函數無法直接賽選這三個關注項目,用sapply(s,colMeans) 的輸出是所有的行。
2019-03-12