将绘图另存为R脚本中的图像
我在linux上运行下面的R脚本,它为每个数据集生成一个绘图将绘图另存为R脚本中的图像,r,R,我在linux上运行下面的R脚本,它为每个数据集生成一个绘图 data_root <- "home/data" diff_dir <- c("C1.HSV_16H.NS.diff", "C1.HSV_8H.NS.diff") png_root <- "/home/hgidnyc/Documents/" library(cummeRbund) for (d in diff_dir) { e <- paste(data_root, d, sep='/') c
data_root <- "home/data"
diff_dir <- c("C1.HSV_16H.NS.diff", "C1.HSV_8H.NS.diff")
png_root <- "/home/hgidnyc/Documents/"
library(cummeRbund)
for (d in diff_dir) {
e <- paste(data_root, d, sep='/')
cuff_data <- readCufflinks(e)
# csDensity
png_file <- paste(paste(png_root, d, sep='/'), 'csDensity.png', sep='.')
png(png_file)
csDensity(cuff_data)
dev.off();
}
它没有像我预期的那样生成png。然而,当我在R控制台中分别复制和粘贴for循环中的每一行时,它就工作了
我错过什么了吗
谢谢您可以将png_文件打印到屏幕上,查看其前缀是否为,从而在Linux系统中将其转换为隐藏文件。png_文件似乎正常。csDensity是否使用基本图形或网格图形?也许试试printcsDensitycuff_dataGod.你救了我一天!!谢谢