Problems saving several pdf files in R

落爺英雄遲暮 提交于 2019-12-06 02:26:34

use pdf directly

for (i in seq_along(gases.names)) {
  # Set ylim
  r_y <- round(range(ratio.cal[,i][ratio.cal[,i]<999], na.rm = T), digits = 1)
  r_y <- c(r_y[1]-0.1, r_y[2]+0.1)

   outputfile <- paste (path, "/cal_ratio_",gases.names[i], ".pdf", sep="")
   pdf(file = outputfile, width = 7, height = 7)
   print(xyplot(ratio.cal[,i] ~ data.GC.all$data.time, groups = data.vial, 
                 panel =  panel.superpose, xlab = "Date", ylab = gases.names[i], 
                 xaxt="n", ylim = r_y))

  dev.off()

}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!