Problems with updating R packages

Hi! I have problems when I am trying to update some packages such as "devtools", "nlme", "rstan", "rstanarm" and "stringi".
When I am trying to update, always appear this message. - in this case with stringi -

install.packages("stringi")

  There is a binary version available but the source version is later:
        binary source needs_compilation
stringi  1.4.4  1.4.6              TRUE

installing the source package ‘stringi’

trying URL 'https://cran.rstudio.com/src/contrib/stringi_1.4.6.tar.gz'
Content type 'application/x-gzip' length 7284354 bytes (6.9 MB)
downloaded 6.9 MB

* installing *source* package 'stringi' ...
** package 'stringi' successfully unpacked and MD5 sums checked
ERROR: cannot remove earlier installation, is it in use?
* removing 'C:/Users/alim/Documents/R/R-3.6.1/library/stringi'
* restoring previous 'C:/Users/alim/Documents/R/R-3.6.1/library/stringi'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
  problema al copiar C:\Users\alim\Documents\R\R-3.6.1\library\00LOCK-stringi\stringi\libs\icudt61l.dat  a C:\Users\alim\Documents\R\R-3.6.1\library\stringi\libs\icudt61l.dat: Invalid argument
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
  problema al copiar C:\Users\alim\Documents\R\R-3.6.1\library\00LOCK-stringi\stringi\libs\x64\stringi.dll  a C:\Users\alim\Documents\R\R-3.6.1\library\stringi\libs\x64\stringi.dll: Permission denied
Warning in install.packages :
  installation of package ‘stringi’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\alim\AppData\Local\Temp\Rtmp0M9VF9\downloaded_packages’

I tried everthing, removing the 00LOCK folder, removing the package and reinstalling it, But I obtain the same result.

Did I something wrong? There is something that I missed? How can I interpret the error?

Regards.

is this the case if you start a new empty session ?
your sessionInfo() doesn't list stringi as loaded / in use ... and then you do install.packages("stringi") and then you get this issue?

Hi! thanks for your answer. Stringi is fixed but the other obtain this message

> install.packages("rstan")

  There is a binary version available but the source version is later:
      binary source needs_compilation
rstan 2.19.2 2.19.3              TRUE

installing the source package ‘rstan’

trying URL 'https://cran.rstudio.com/src/contrib/rstan_2.19.3.tar.gz'
Content type 'application/x-gzip' length 922337 bytes (900 KB)
downloaded 900 KB

* installing *source* package 'rstan' ...
** package 'rstan' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined
* removing 'C:/Users/alim/Documents/R/R-3.6.1/library/rstan'
* restoring previous 'C:/Users/alim/Documents/R/R-3.6.1/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\alim\AppData\Local\Temp\RtmpS0xVzE\downloaded_packages’
> install.packages("rstanarm")

  There is a binary version available but the source version is later:
         binary source needs_compilation
rstanarm 2.19.2 2.19.3              TRUE

installing the source package ‘rstanarm’

trying URL 'https://cran.rstudio.com/src/contrib/rstanarm_2.19.3.tar.gz'
Content type 'application/x-gzip' length 3534835 bytes (3.4 MB)
downloaded 3.4 MB

* installing *source* package 'rstanarm' ...
** package 'rstanarm' successfully unpacked and MD5 sums checked
** using staged installation
** libs

*** arch - i386
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined
* removing 'C:/Users/alim/Documents/R/R-3.6.1/library/rstanarm'
* restoring previous 'C:/Users/alim/Documents/R/R-3.6.1/library/rstanarm'
Warning in install.packages :
  installation of package ‘rstanarm’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\alim\AppData\Local\Temp\RtmpS0xVzE\downloaded_packages’
> install.packages("devtools")

  There is a binary version available but the source version is later:
         binary source needs_compilation
devtools  2.2.1  2.2.2             FALSE

installing the source package ‘devtools’

trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.2.2.tar.gz'
Content type 'application/x-gzip' length 375464 bytes (366 KB)
downloaded 366 KB

* installing *source* package 'devtools' ...
** package 'devtools' successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error: package or namespace load failed for 'usethis':
 .onLoad failed in loadNamespace() for 'rlang', details:
  call: on_package_load("glue", .Call(rlang_glue_is_there))
  error: objeto 'rlang_glue_is_there' no encontrado
Error: package 'usethis' could not be loaded
Ejecución interrumpida
ERROR: lazy loading failed for package 'devtools'
* removing 'C:/Users/alim/Documents/R/R-3.6.1/library/devtools'
* restoring previous 'C:/Users/alim/Documents/R/R-3.6.1/library/devtools'
Warning in install.packages :
  installation of package ‘devtools’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\alim\AppData\Local\Temp\RtmpS0xVzE\downloaded_packages’

How can I fixed?
Regards

Can you concentrate on one package at a time? There is no installation troubleshooting to rule them all, each one is different.

In the case of the rstan package I'm afraid you are going to have to choose to install the binary version even if it is a little older, because the compiling error it has to do with the source itself so I think it has to be fixed by the mantainer.

Your problem with devtools is that you are missing package dependencies (usethis and rlang), try installing those first.

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