Although the @CMichael comment is good (I did not know this, therefore +1), it is only applicable if you want to save a specific plot from a GGally-generated matrix. I believe that you want to keep the entire plot matrix - a necessity that I recently experienced. Therefore, you can use the standard R approach and save graphics by opening the corresponding graphics device (in the desired format), printing an object and closing the device, which effectively saves the graphics in the desired format.
# use pdf() instead of svg(), if you want PDF output svg("myPlotMatrix.svg", height = 7, width = 7) g <- ggpairs(...) print(g) dev.off()
Aleksandr Blekh
source share