【问题标题】:Draw adjacent related plots from different dataframes on the same png从同一个 png 上的不同数据帧中绘制相邻的相关图
【发布时间】:2014-10-05 03:35:47
【问题描述】:

我有两个名为 retraw 的数据框。我单独处理数据帧,以便每个数据帧输出一系列图。每个图代表不同的染色体。两个数据框都按相同的染色体分组(但每个数据框的 x 轴和 y 轴测量不同的东西,因此数据不能合并在一起)。我希望输出显示来自数据帧ret(称为ret$chr)的染色体与来自数据帧raw(称为raw$Chromosome)的同一染色体相邻的图。目前我的代码是:

# Plot the bins and sums for each chromosome. (png,pdf,ps,tiff)
ind = unique(as.character(ret$chr))
ind2 = unique(as.character(raw$Chromosome))
png(filename=paste("/Users/blabla/Desktop/SequencingScripts/Plots/temp","png"), width = 600, height = 2000)
par(mfrow=c(8,3), mar = rep(0.5, 4), oma = rep(0.5, 4))

for(jj in ind){
indic = which(ret$chr == jj)
indic2 = which(raw$Chromosome == jj)
plot(ret$retxvalue[indic],ret$retyvalue[indic],pch=19,xlab="Locus",ylab="Summed ZScore",type="s",main=jj,lwd=2, ylim=c(-1,2.5))
plot(raw$rawxvalue[indic2],raw$rawyvalue[indic2],pch=19,xlab="Locus",ylab="Ratio",type="s",main=jj,lwd=2, ylim=c(-1,2.5)xlim=c(0,20000))
}
dev.off()

但是我不断收到错误:

Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf

【问题讨论】:

    标签: r


    【解决方案1】:

    是复制粘贴错误吗? (好像你失去了昏迷)

     ylim=c(-1,2.5)xlim=c(0,20000)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多