我有一个包含 1200 个探针(行)和两组数组,每组九列的数据框。前九列被命名为“正”,接下来的九列被命名为“负”。我想通过使用箱线图选择 12 个随机探针来表明表达式是正常的。我的代码如下所示:
f<-c(rep("positive", 9), rep("negative", 9))
for(i in seq(from=1, to=1200, by=10)){
boxplot(probes[i]~f,col="lightblue",main="Expression of genes studied Cells")
}
但我收到以下错误:
Error in model.frame.default(formula = probes[i] ~ f) :
variable lengths differ (found for 'f')
如果我将箱线图用于单个探针,它可以正常工作。我得到两个框,一个对应于“正面”,另一个对应于“负面”:
f<-c(rep("positive", 9), rep("negative", 9))
genex<-as.numeric(dat.fp.labeled["NM_139321.1_psr1_at",])
boxplot(genex~f,col="lightblue",main="Expression of NM_139321.1_psr1_at samples")