Plotting and saving PDFs in a loop

前端 未结 2 1089
温柔的废话
温柔的废话 2021-01-15 20:20

I have a semi-melted data frame that looks like this:

head(final_melt)

   Group       Source variable   value
 Control Whole Kidney     MZF1 0.23879
 Contro         


        
2条回答
  •  孤独总比滥情好
    2021-01-15 21:04

    As an alternative to joran's answer for ggplot2 graphics only:

    1. Create and print your ggplot graphic.
    2. ggsave(filename="Whole Kidney.pdf")

    The ggsave will copy the last printed graphic. Or it can save a particular plot.

    1. Create your ggplot graphic and assign it to p
    2. ggsave(filename="Whole Kidney.pdf", p)

提交回复
热议问题