Relative Content

Tag Archive for rfunctionplotchord-diagramchord

Suppressing a plot as part of a function

I’ve written a short function that generates a chord diagram. I want the function to output the plot as an object that I can use down the line in a PDF, or save to an RData file. However, I don’t want it outputting to the console. That’s because this is part of an rmarkdown file, and I don’t want it cluttered with plots. I can’t seem to find a way to suppress the plot without disrupting the recordPlot() function. For example, pdf(NULL) stops it recording the plot. Can anyone think of a solution? Here’s a worked example: