title: rmarkdown knitting error cannot replicate NULL to a non-zero length
body: <p>I have a rmarkdown which loops to render a list of other rmarkdowns:</p>
  <pre><code>```{r}
  for(i in 0:22){
     save(i, file = &quot;/path/to/i.RData&quot;)
     rmarkdown::render(&quot;path/to/secondRmarkdown.Rmd&quot;, output_file = paste0(&quot;/path/to/Results/Report_&quot;, i, &quot;.html&quot;))
  }
  ```
  </code></pre>
  <p>Previous to this chunk, I have a pretty similar chunk in the same rmarkdown, and it loops without a problem while knitting the main one. Moreover, when I run the chunk manually, it also loops.</p>
  <p>However, when knitting, this specific chunk gives the following error after rendering only the first rmarkdown file for i=0 (which succeeds):</p>
  <pre><code># Error in rep_len(label, length(meta): cannot replicate NULL to a non-zero length
  </code></pre>
  <p>I modified the <em>secondRmarkdown.Rmd</em> to a simple file to make sure it wasn't something from it:</p>
  <pre><code>```{r}    
  load(file = &quot;/path/to/i.RData&quot;)
  print(i)
  ```
  </code></pre>
  <p>I have Ubuntu 5.13.0-40. R version 4.2.0, Rstudio version 2022.02.2, rmarkdown version 2.14</p>
  <p>Any idea? TIA!</p>