I'am unable to crate a R markdown file, everytime this error shows up

Please ask your qInstalling 'stringi' for R Markdown...

Installing package into 'C:/Users/janha/OneDrive/Documents/R/win-library/4.1'
(as 'lib' is unspecified)

There is a binary version available but the source version is later:
binary source needs_compilation
stringi 1.6.1 1.6.2 TRUE

installing the source package 'stringi'

==================================================
downloaded 7.2 MB

  • installing source package 'stringi' ...
    ** package 'stringi' successfully unpacked and MD5 sums checked
    ** using staged installation
    Warning in system("sh ./configure.win") : 'sh' not found
    ERROR: configuration failed for package 'stringi'
  • removing 'C:/Users/janha/OneDrive/Documents/R/win-library/4.1/stringi'

The downloaded source packages are in
'C:\Users\janha\AppData\Local\Temp\Rtmp4aMmFl\downloaded_packages'

<U+2714> Package 'stringi' successfully installed.
Warning message:
In utils::install.packages("stringi", repos = "https://cran.rstudio.com/") :
installation of package 'stringi' had non-zero exit statusuestions about R Markdown here.

This seems to be a problem with RTools, either install the binary version of the package or verify that you have the proper RTools version for your R version.

Also, setting your package library in a cloud synced folder (OneDrive in your case) brings installation problems very often so I recommend you to set your package library in a non synced folder. You can change the default library folder by setting your R_LIBS_SITE environmental variable on a .Reviron or .Rprofile file

# For example, in a .Renviron file you can set it by adding a line like this with the desired path. 
R_LIBS_SITE="C:\\Program Files\\R\\R-4.1.0\\library"

For a more detailed explanation, you can read this blog post

1 Like

Also...
Why install.packages in an Rmd ? I find this often when people cut and paste a solution from the internet. Packages only usually need installed once. Then just load them with library/require

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.