html visualized upside down by RStudio after knitting an R mark down document

Viewed 305

Since I changed my laptop for a new m1 macbook every time I knit a document the html visualized in Rstudio is upside down, while when I open it with a browser it has no problem. I tried to update the knitr package but with no success. I paste my sessionInfo():

> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS  10.16

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_4.0.2    rsconnect_0.8.16  htmltools_0.5.1.1 tools_4.0.2       yaml_2.2.1        rmarkdown_2.3     knitr_1.32        xfun_0.22         digest_0.6.25    
[10] rlang_0.4.7       evaluate_0.14   

And here the link to the upside down weird visualization:

knitted html file

The same happens when I try to use git integrated in RStudio, making impossible to use the integration.

1 Answers

Sadly, I think the only solution is to knit the file (command + K) and open the resulting .html file using a browser.

For reference, I am running Big Sur on an intel i5 processor. I think it's a Mac OS problem rather than the M1 chip.

Alternatively, you can try installing a legacy version of knitr.

Related