Skip to content
Prev 387382 / 398502 Next

Specifying plot file name in the rscript

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, choix="var", axes=c(1,2))
dev.off()

pdf("ind_plot.pdf")
plot(res.pca, choix="ind", axes=c(1,2))
dev.off()

See ?device for a listing of available devices.

Ben


On Tue, Mar 9, 2021 at 7:11 AM Mahmood Naderan-Tahan
<mahmood.naderan at ugent.be> wrote: