title: How do I assign a random seed to the dplyr sample_n function?
body: <p>This is the &quot;sample_n&quot; from dplyr in R.<br />
  <a href="https://dplyr.tidyverse.org/reference/sample.html" rel="noreferrer">https://dplyr.tidyverse.org/reference/sample.html</a></p>
  <p>For reproducibility, I should place a seed so that someone else can get my exact  results.</p>
  <p>Is there a built-in way to set the seed for &quot;sample_n&quot;?
  Is this something that I do in the environment and &quot;sample_n&quot; responds to it?</p>
  <p>These are not built-into the &quot;sample_n&quot; function.</p>
  <ul>
  <li>There is the environment &quot;set.seed&quot; function <a href="https://irudnyts.github.io//setting-a-seed-in-r-when-using-parallel-simulation/" rel="noreferrer">[1]</a></li>
  <li>There is a library 'withr' that creates a seed-containing wrapper for code <a href="https://cran.r-project.org/web/packages/withr/withr.pdf" rel="noreferrer">[2]</a></li>
  </ul>
  <p>.</p>