rowMeans中的错误(结果,na.rm = T):'x'必须是至少两个维度的数组

时间:2016-07-06 21:58:54

标签: arrays r analytics

我正在尝试关注this site中某些R代码的示例,但我收到的错误如下所示。

>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

做得更好

1 个答案:

答案 0 :(得分:0)

在原始作业声明中,您将RS_simulation()调用的输出保存到名为Results的变量中,然后尝试绘制来自results的内容。 R区分大小写 - 一致的情况下你应该好好去。