How to not display a plot drawn by a function and obtain only invisible object?
<p>If a function draws a graph inside the function using <code>plot</code> and also returns an invisible object, how do I only keep the object and not display the plot?</p>

<pre><code>some_func &lt;- function() {
  plot(1:10)
  return(invisible(10))
}

my_value &lt;- some_func() # R/Rstudio draws a plot! don't want that
</code></pre>