title: R file for required packages
body: <p>I have recently started using RStudio (2022.02.0) and specifically R Markdown. However, I can not figure out the following: In which file is the information stored about which packages should be loaded? I imagine there needs to be a file similar to nodes <code>package.json</code>. I could not make out any file in the project folder, hidden or not, that contained the required packages. I never bothered about this before because it never caused a problem. However, I would now like to explicitly specify every package I need in the markdown document via <code>library()</code> and remove all ambiguity about package inclusion (it's for a uni project).</p>
  <p>More specifically, I am talking about this r markdown code:</p>
  <pre><code>---
  title: &quot;RMarkdown test&quot;
  output: html_notebook
  ---
  
  ```{r}
  plot(cars)
  ```
  
  </code></pre>
  <p>This code works and plots the dataframe <code>cars</code> from the <code>datasets</code> package using the function <code>plot</code> from the <code>graphics</code> package. However, the only way I can see which package is loaded is via the &quot;Packages&quot; tab in RStudio. The code itself does not make any of that explicit.</p>
  <p>Now my specific questions:</p>
  <ol>
  <li>Where is the information about required packages stored?</li>
  <li>Can I somehow deactivate all &quot;implicit&quot; usage of packages and make r throw an error if a package is not explicitly loaded within the file itself via <code>library()</code>?</li>
  </ol>
  <p>I know that this question might seem trivial to you, but I could just not find an answer on stackoverflow, google, the R docs, or anywhere else.</p>