You can use the ggsave() function to export the arranged plots to a file in various formats, such as PDF, PNG, JPEG, or SVG. You need to specify the filename, the plot object, and the width and height of the output file. The file will be saved on the working directory, read more:How to Set Working Directory setwd in R. For example, the following code exports the plot object p7 to a PDF file named “plots.pdf” with a width of 10 inches and a height of 8 inches: ggsave("plots.pdf", p7, width = 10, height = 8)