Re: [R] Specifying plot file name in the rscript

2021-03-09 Thread Mahmood Naderan-Tahan
Right. Thank you very much. Regards, Mahmood From: Ben Tupper Sent: Tuesday, March 9, 2021 2:58:17 PM To: Mahmood Naderan-Tahan Cc: r-help@r-project.org Subject: Re: [R] Specifying plot file name in the rscript Hi, When you call plot() it will draw to the

Re: [R] Specifying plot file name in the rscript

2021-03-09 Thread Ben Tupper
Hi, When you call plot() it will draw to the default device - in your case the pdf() device. When the default device results in a file, R selects a filename for you unless you tell it otherwise. You can specify the filename by explicitly calling pdf() first. pdf("var_plot.pdf") plot(res.pca, cho

[R] Specifying plot file name in the rscript

2021-03-09 Thread Mahmood Naderan-Tahan
Hi I use the following R script to plot two graphs. library(FactoMineR) mydata <- read.csv('test.csv', header=T,row.names=1) res.pca = PCA(mydata, quali.sup=5, graph=F) plot(res.pca, choix="var", axes=c(1,2)) dev.new() plot(res.pca, choix="ind", axes=c(1,2)) After running "Rscript my.r", I see