I'm having trouble loading my knitcitations package for R markdown. It keeps giving me the following error message:
> library(knitcitations)
Error: package or namespace load failed for ‘knitcitations’ in loadNamespace(i,
c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called
‘stringi’
I've tried to uninstall and reinstall knitcitations as well as use installl.packages("stringi", repos="http://cran.rstudio.com/", dependencies=TRUE), however neither of those seem to be working. Any help would be greatly appreciated.
> install.packages("stringi", repos="http://cran.rstudio.com/", dependencies=TRUE)
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into ‘C:/Users/Owner/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
stringi 1.4.6 1.5.3 TRUE
installing the source package ‘stringi’
trying URL 'http://cran.rstudio.com/src/contrib/stringi_1.5.3.tar.gz'
Content type 'application/x-gzip' length 7293930 bytes (7.0 MB)
downloaded 7.0 MB
ERROR: failed to lock directory 'C:/Users/Owner/Documents/R/win-library/3.6' for modifying
Try removing 'C:/Users/Owner/Documents/R/win-library/3.6/00LOCK-stringi'
Warning in install.packages :
installation of package ‘stringi’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Owner\AppData\Local\Temp\RtmpOoyjmi\downloaded_packages’
It also mentions in the beginning warning that I don't have Rtools installed, which I made sure I did have.
That worked!! Thank you so much! I was able to download the stringi package and load both that and knitcitations correctly. My document is also knitting properly now.
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: