title: stargazer error "length of NULL cannot be changed" when running rchunk in rmarkdown only
body: <p>I teach econometrics using Rmarkdown on my university's rstudio pro server, running R 3.6.3. Whenever I run an rchunk using stargazer to display regression results, I get a preamble of errors before the table. Here is a copy and paste of the code and the exact results after running the code chunk:</p>
  
  <pre><code>lm.1 &lt;- lm(mpg ~ cyl,data=mtcars)
  stargazer(lm.1,type="text")
  </code></pre>
  
  <blockquote>
    <p>length of NULL cannot be changedlength of NULL cannot be changedlength of NULL cannot be changedlength of NULL cannot be changedlength of NULL cannot be changed</p>
  </blockquote>
  
  <pre><code>===============================================
                          Dependent variable:    
                      ---------------------------
                                  mpg            
  -----------------------------------------------
  cyl                          -2.876***         
                                (0.322)          
  
  Constant                     37.880***         
                                (2.074)          
  
  -----------------------------------------------
  Observations                    32             
  R2                             0.726           
  Adjusted R2                    0.717           
  Residual Std. Error       3.206 (df = 30)      
  F Statistic           79.560*** (df = 1; 30)   
  ===============================================
  Note:               *p&lt;0.1; **p&lt;0.05; ***p&lt;0.01
  
  </code></pre>
  
  <p>This error happens whether I use type= text, html, or latex.</p>
  
  <p>Although the error does not show up in the knitted report, most of the work that the students do is simply running the r chunk. And, so every students gets a preamble of errors in bright red text before every regression results table they see. Not helpful in convincing them R and its useful packages are modern, stable, and professional tool for writing statistical reports.</p>
  
  <p>Does anyone know what could be causing this error from stargazer and how to get rid of it?</p>
  
  <p>EDIT: in reply to @J_F (thank you for your comment)</p>
  
  <p>Here is the sessionInfo() output:</p>
  
  <blockquote>
    <p>sessionInfo()</p>
  </blockquote>
  
  <p>R version 3.6.3 (2020-02-29)
  Platform: x86_64-pc-linux-gnu (64-bit)
  Running under: Ubuntu 18.04.4 LTS</p>
  
  <p>Matrix products: default
  BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
  LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1</p>
  
  <p>locale:
   [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8<br>
   [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C<br>
   [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       </p>
  
  <p>attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     </p>
  
  <p>other attached packages:
  [1] stargazer_5.2.2</p>
  
  <p>loaded via a namespace (and not attached):
  [1] compiler_3.6.3 tools_3.6.3    knitr_1.27     xfun_0.12     </p>
  
  <p>Here is the entirety of my .rmd file:</p>
  
  <pre><code>---
  title: "stargazer test"
  output: html_document
  ---
  </code></pre>
  
  <pre><code>library(stargazer)
  knitr::opts_chunk$set(echo = TRUE)
  </code></pre>
  
  <pre><code>lm1 &lt;- lm(mpg ~ cyl, data = mtcars)
  stargazer(lm1,type="text")
  </code></pre>