2016-07-06 50 views
-2

我試圖按照this site中的一些R代碼的示例進行操作,但出現如下所示的錯誤。rowMeans中的錯誤(結果,na.rm = T):'x'必須是至少有兩個維度的數組

>Results = RS_simulation(sims=5, params=params, budget=3000, designtype = "one factor", nmax = 20, nmin = 5, program="DESeq") 
    [1] "DESeq" 
> plot(rownames(results),rowMeans(results, na.rm=T), main="DESeq simulations on Bottomly Dataset", xlab = "number of replicates", ylab = "Power") 
    Error in rowMeans(results, na.rm = T) : 
     'x' must be an array of at least two dimensions 

我已經試過此命令爲好,但得到這樣的:

> plot(rownames(results),rowMeans(results[, na.rm=T, drop=FALSE]), main="DESeq simulations on Bottomly Dataset", xlab = "number of replicates", ylab = "Power", drop=FALSE) 
Error in results[, na.rm = T, drop = FALSE] : 
    object of type 'closure' is not subsettable 

任何這方面的幫助?總是試圖獲得在r

回答

0

更好地在原來的賦值語句,你從RS_simulation()調用的輸出保存到一個名爲Results變量,然後嘗試從results繪製的東西。 R區分大小寫 - 一致的情況下,你應該很好去。

+0

謝謝,省了很多頭痛 – Labrat

相關問題