Knit button not working in Rstudio


#1

Hi all,

The knit button in my Rstudio has stopped working, throwing the error below:

Error in loadNamespace(name) : there is no package called 'rmarkdown'
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

I have followed the suggestions from here, here, here, here, here and here. To summarise, they mostly suggest checking library permissions (no issues) and reinstalling rmarkdown and various other packages (tried with no difference).

Running rmarkdown::render() still works. Does anyone have ideas as to why the knit button doesn’t??

Thanks!

Output of sessionInfo() below:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252
[4] LC_NUMERIC=C                       LC_TIME=English_Australia.1252    

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

loaded via a namespace (and not attached):
 [1] compiler_3.4.3  backports_1.1.2 magrittr_1.5    rprojroot_1.3-2 htmltools_0.3.6 tools_3.4.3     yaml_2.1.16    
 [8] Rcpp_0.12.15    stringi_1.1.6   rmarkdown_1.9   knitr_1.20      stringr_1.3.0   digest_0.6.15   evaluate_0.10.1

#2

This may be due to a corrupt .Rdata file. Have you tried

  • exiting RStudio
  • blowing away .Rdata in the directory you’re trying to knit to
  • re-starting?

Simply re-starting RStudio can cure a number of ills…


#3

Thanks for the suggestion. I haven’t tried deleting the .Rdata file, will give that a go. I’m not hopeful because I think I’ve tried in a clean directory, but will confirm.

I should have also said I have tried completely uninstalling and reinstalling Rstudio, and also deleting the Rstudio-Desktop folder in AppData/Local with no luck.


#4

No good :frowning:
Any other ideas?


#5

Bump... Anyone got ideas?


#6

Because you're bumping, I give you worked for me for a problem remotely similar to yours.
Put this at the beginning of you .Rmd file:

\```{r, echo=FALSE}
knitr::opts_chunk$set(error = TRUE)
\```