Plotting and saving PDFs in a loop

前端 未结 2 1062
温柔的废话
温柔的废话 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)
    0 讨论(0)
  • 2021-01-15 21:13
    1. Open a graphics device (pdf(), png() etc.)
    2. Create and print your ggplot or lattice graphic.
    3. Call dev.off().
    4. .....?
    5. Profit.

    In that order.

    0 讨论(0)
提交回复
热议问题