我有下面的命令用于在 R 中制作绘图。主要的文本文件是 cross_correlation.csv。
我怎样才能把它放在 bash 脚本中,这样当我在终端上启动它时,R 命令将执行它们的工作并完成(像所有其他 shell 脚本一样)。
cross_correlation <- read.table(file.choose(), header=F, sep="\t")
barplot(cross_correlation$V3)
dev.copy(png,"cc.png",width=8,height=6,units="in",res=100)
dev.off()
hist(cross_correlation$V3, breaks=15, prob=T)
dev.copy(png,"hist_cc.png",width=8,height=6,units="in",res=100)
dev.off()
Run Code Online (Sandbox Code Playgroud)