morg
morg

Reputation: 421

Knitr Not Loading/Not Found?

I recently updated RStudio to 3.6.2 for a package or something I had wouldn't work on my 3.5 version. However, I do not know if my knitr problem started before or after my update. I start on a R script that renders rmarkdown. Once it starts rendering it says:

> rmarkdown::render(input = "file.rmd", params=list(Start_Date = rpt .... [TRUNCATED] 
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘knitr’

Knitr does not show up to update and when I try to install it again it says:

> install.packages("knitr")

  There is a binary version available but the source version is later:
      binary source needs_compilation
knitr   1.27   1.28             FALSE

installing the source package ‘knitr’

trying URL 'https://cran.rstudio.com/src/contrib/knitr_1.28.tar.gz'
Content type 'application/x-gzip' length 884866 bytes (864 KB)
downloaded 864 KB

'\\file\path_file\myname'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported.  Defaulting to Windows directory.
'\\file\path_file\myname\R\R-3.6.2' is not recognized as an internal or external command,
operable program or batch file.
Warning in install.packages :
  installation of package ‘knitr’ had non-zero exit status

The downloaded source packages are in
    ‘K:\Users\AppData\Local\Temp\RtmpoJyMI4\downloaded_packages’

I really have no clue why this is happening. These files I am running worked perfectly last week. Let me know if I'm missing more information.

Upvotes: 2

Views: 1776

Answers (1)

Yihui Xie
Yihui Xie

Reputation: 30184

Update: The Windows binary is available on CRAN now; install.packages("knitr") should just work.


I don't know why the latest Windows binary version of knitr is still not available on CRAN yet, but you don't have to install the latest version. You can set options(install.packages.check.source = "no") before you install the package, and it will install the older binary version.

Or wait for a few more days till the binary version is provided on CRAN: https://cran.r-project.org/package=knitr.

Upvotes: 1

Related Questions