Installation of pkgconfig on Windows - r

I have successfully installed and loaded readxl package. When I am trying to use the function readxl::read_xlsx(), it throws and error that R cannot find pkgconfig.
I have tried to install this package, but it throws another error, which is presented below:
Installing package into ‘C:/Users/Maintenant Prêt!/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
pkgconfig 2.0.2 2.0.3 FALSE
installing the source package ‘pkgconfig’
trying URL 'https://cran.rstudio.com/src/contrib/pkgconfig_2.0.3.tar.gz'
Content type 'application/x-gzip' length 6080 bytes
downloaded 6080 bytes
* installing *source* package 'pkgconfig' ...
** package 'pkgconfig' successfully unpacked and MD5 sums checked
** using staged installation
Warning in file(file, if (append) "a" else "w") :
cannot open file 'C:/Users/Maintenant Prjt!/Documents/R/win-library/3.6/00LOCK-pkgconfig/00new/pkgconfig/DESCRIPTION': No such file or directory
Error in file(file, if (append) "a" else "w") :
cannot open the connection
ERROR: installing package DESCRIPTION failed for package 'pkgconfig'
* removing 'C:/Users/Maintenant Prêt!/Documents/R/win-library/3.6/pkgconfig'
Warning in install.packages :
installation of package ‘pkgconfig’ had non-zero exit status
I have checked and there are no hidden 00LOCK folders in packages folder, which can conflict with installation. My three suggestions are: (1) either there are no writing rights to this folder (which is wired since all packages are installed normally), (2) or a special symbol ê in the name of the parent folder creates problems.
Does anyone know a workaround?
Here are results of the sessionInfo() and .libPaths():
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] readxl_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.2 crayon_1.3.4 assertthat_0.2.1 cellranger_1.1.0
[5] R6_2.4.0 magrittr_1.5 pillar_1.4.2 rlang_0.4.0
[9] rstudioapi_0.10 tools_3.6.1 glue_1.3.1 compiler_3.6.1
and
[1] "C:/Users/Maintenant Prêt!/Documents/R/win-library/3.6"
[2] "C:/Program Files/R/R-3.6.1/library"

Related

Fixing rlang access denied

Can't seem to find a viable solution getting rlang to install after updating rstudio.
I tried using --no lock on builder tools https://work.sparktseung.com/pages/2021-09-06-R-build-package-permission/
Also tried uninstalling it and reinstalling w/ remove.packages this hasn't worked for me either after restarting.
> library(rlang)
Error in library(rlang) : there is no package called ‘rlang’
> remove.packages("rlang")
Removing package from ‘C:/Users/user/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘rlang’
Restarting R session...
> library(rlang)
Error in library(rlang) : there is no package called ‘rlang’
Here's the error when trying to install via url
Warning in file.rename(instdir, final_instdir) :
cannot rename file 'C:/Users/user/AppData/Local/R/win-library/4.2/00LOCK-rlang/00new/rlang' to 'C:/Users/user/AppData/Local/R/win-library/4.2/rlang', reason 'Access is denied'
ERROR: moving to final location failed
* removing 'C:/Users/user/AppData/Local/R/win-library/4.2/rlang'
Warning in install.packages :
installation of package ‘C:/Users/user/AppData/Local/Temp/Rtmp8sB5rS/downloaded_packages/rlang_1.0.5.tar.gz’ had non-zero exit status
Install Line
install.packages("https://cran.r-project.org/src/contrib/Archive/rlang/rlang_1.0.5.tar.gz", repo=NULL, type="source")
Session Info
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.2.0 tools_4.2.0
Really need to run some scripts, any help would be appreciated.

Cannot install RStudio addins on my Windows laptop from behind proxy

My session info (basically it's Microsoft R Open 3.4.1, RStudio 1.0.153, Windows 10 64 bit)
> sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils
[5] datasets methods base
other attached packages:
[1] RevoUtilsMath_10.0.1
loaded via a namespace (and not attached):
[1] httr_1.3.1 compiler_3.4.1
[3] R6_2.2.0 RevoUtils_10.0.6
[5] tools_3.4.1 withr_2.0.0
[7] curl_2.6 memoise_1.1.0
[9] git2r_0.19.0 digest_0.6.12
[11] devtools_1.13.3
I'm trying to install some RStudio addins without success. Whatever addin I try to install, the recommended procedure of using devtools::install_github (see Installation) fails with the same error message:
> devtools::install_github("benmarwick/wordcountaddin", type = "source", dependencies = TRUE)
Installation failed: Failure when receiving data from the peer
> devtools::install_github("rstudio/addinexamples", type = "source")
Installation failed: Failure when receiving data from the peer
I work behind a company proxy. I am able to install R packages from CRAN without problems:
> install.packages("devtools")
Installing package into ....
(as ‘lib’ is unspecified)
trying URL 'https://mran.microsoft.com/snapshot/2017-09-01/bin/windows/contrib/3.4/devtools_1.13.3.zip'
Content type 'application/zip' length 443758 bytes (433 KB)
downloaded 433 KB
package ‘devtools’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
....
How can I install RStudio addins?
You can install from github using proxy settings with httr package:
library(httr)
with_config(use_proxy(url='proxy url', port = port_number,
username="username", password="yourpass"),
devtools::install_github('github/directory'))

Can't install r package "bsts" due to "had status 127"

I can't install package "bsts":
> install.packages("bsts")
also installing the dependencies ‘BoomSpikeSlab’, ‘Boom’
There are binary versions available but the source versions are later:
binary source needs_compilation
BoomSpikeSlab 0.5.2 0.7.0 TRUE
Boom 0.2 0.5 FALSE
bsts 0.6.2 0.6.5 TRUE
Binaries will be installed
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/BoomSpikeSlab_0.5.2.zip'
Content type 'application/zip' length 2359323 bytes (2.3 MB)
downloaded 2.3 MB
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.2/bsts_0.6.2.zip'
Content type 'application/zip' length 2612461 bytes (2.5 MB)
downloaded 2.5 MB
package ‘BoomSpikeSlab’ successfully unpacked and MD5 sums checked
package ‘bsts’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\R612965\AppData\Local\Temp\RtmpMRjXXu\downloaded_packages
installing the source package ‘Boom’
trying URL 'http://cran.rstudio.com/src/contrib/Boom_0.5.tar.gz'
Content type 'application/x-gzip' length 1061942 bytes (1.0 MB)
downloaded 1.0 MB
* installing *source* package 'Boom' ...
** package 'Boom' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "Makevars" -f "C:/FAST/R/323F40~1.1/etc/i386/Makeconf"
-f "C:/FAST/R/323F40~1.1/share/make/winshlib.mk" CXX='$(CXX1X) $(CXX1XSTD)'
CXXFLAGS='$(CXX1XFLAGS)' CXXPICFLAGS='$(CXX1XPICFLAGS)'
SHLIB_LDFLAGS='$(SHLIB_CXX1XLDFLAGS)' SHLIB_LD='$(SHLIB_CXX1XLD)'
SHLIB="Boom.dll" ' had status 127
ERROR: compilation failed for package 'Boom'
* removing 'C:/FAST/R/3.2.1/library/Boom'
Warning in install.packages :
running command '"C:/FAST/R/323F40~1.1/bin/x64/R" CMD INSTALL -l
"C:\FAST\R\3.2.1\library" C:\Users\R612965
\AppData\Local\Temp\RtmpMRjXXu/downloaded_packages/Boom_0.5.tar.gz' had status 1
Warning in install.packages :
installation of package ‘Boom’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\R612965\AppData\Local\Temp\RtmpMRjXXu\downloaded_packages’
I have also tried install dependencies 'BoomSpikeSlab' and 'Boom' first which returns me very similar issue like the one above - 'had status 127'. Directly install from source file like tar.gz is also not working. How can I approach this issue?
I have also attached my session information below:
R version 3.2.1 (2015-06-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BH_1.60.0-2 sqldf_0.4-10 RSQLite_1.0.0 DBI_0.5-1 gsubfn_0.6-6 proto_1.0.0 dtplyr_0.0.1 data.table_1.9.6 reshape2_1.4.2
[10] scales_0.4.1 gtable_0.2.0 dplyr_0.5.0 devtools_1.12.0 httr_1.2.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.7 magrittr_1.5 munsell_0.4.3 colorspace_1.2-7 R6_2.2.0 stringr_1.1.0 plyr_1.8.4 tcltk_3.2.1 tools_3.2.1
[10] grid_3.2.1 git2r_0.15.0 withr_1.0.2 assertthat_0.1 digest_0.6.10 tibble_1.2 curl_2.2 memoise_1.0.0 stringi_1.1.2
[19] chron_2.3-47
I am using Windows 7 op.

Error with installing an old package

A co-worked built a model using both an older version of R (3.1.3) and an older version of randomForestSRC (1.6.0). I have R version 3.2.1 and randomForestSRC version 1.6.1. I was able to install an older version of the randomForestSRC package using the function InstallOldPackage from the repmis package using R 3.2.1. However, it turns out I need to use the old version (3.1.3) to be able to work on this project. Unfortunately, after switching to 3.1.3 I am having trouble actually installing the older version of the randomForestSRC package.
Here is the system info:
> sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2012 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base
other attached packages:
[1] repmis_0.4.4 randomForestSRC_1.6.1
loaded via a namespace (and not attached):
[1] chron_2.3-47 data.table_1.9.6 digest_0.6.8 httr_1.0.0 magrittr_1.5
[6] plyr_1.8.3 R.cache_0.10.0 R.methodsS3_1.7.0 R.oo_1.19.0 R.utils_2.1.0
[11] R6_2.1.1 Rcpp_0.12.1 stringi_1.0-1 stringr_1.0.0 tools_3.1.3
This is where I run into the error (I apologize for the large block of text):
> library(repmis)
> InstallOldPackages(pkgs = "randomForestSRC",versions = "1.6.0")
trying URL 'http://cran.r- project.org/src/contrib/Archive/randomForestSRC/randomForestSRC_1.6.0.tar.gz'
Content type 'application/x-gzip' length 943881 bytes (921 KB)
opened URL
downloaded 921 KB
* installing *source* package 'randomForestSRC' ...
** package 'randomForestSRC' successfully unpacked and MD5 sums checked
** libs
*** arch - i386
Warning: running command 'make -f "C:/Users/baasman/DOCUME~1/R/R- 31~1.3/etc/i386/Makeconf" -f "C:/Users/baasman/DOCUME~1/R/R- 31~1.3/share/make/winshlib.mk" SHLIB="randomForestSRC.dll" OBJECTS="bootstrap.o classification.o dataParser.o entry.o factorOps.o importance.o impute.o nodeOps.o nrutil.o random.o regression.o rfsrc.o rfsrcUtil.o split.o splitClas.o splitCustom.o splitRegr.o splitSurv.o splitUspv.o splitUtil.o stack.o stackOutput.o stackPreDefined.o survival.o survivalE.o termOps.o trace.o tree.o treeUtil.o"' had status 127
ERROR: compilation failed for package 'randomForestSRC'
* removing 'C:/Users/baasman/Documents/R/R-3.1.3/library/randomForestSRC'
* restoring previous 'C:/Users/baasman/Documents/R/R- 3.1.3/library/randomForestSRC'
Warning in file.copy(lp, dirname(pkgdir), recursive = TRUE, copy.date = TRUE) :
problem copying C:\Users\baasman\Documents\R\R-3.1.3\library\00LOCK- randomForestSRC\randomForestSRC\libs\x64\randomForestSRC.dll to C:\Users\baasman\Documents\R\R- 3.1.3\library\randomForestSRC\libs\x64\randomForestSRC.dll: Permission denied
Warning in install.packages :
running command '"C:/Users/baasman/DOCUME~1/R/R-31~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\baasman\Documents\R\R-3.1.3\library" "randomForestSRC_1.6.0.tar.gz"' had status 1
Warning in install.packages :
installation of package ‘randomForestSRC_1.6.0.tar.gz’ had non-zero exit status
pkgs V1
1 randomForestSRC 0

Gain Package Installation error in R 3.1.2

I am trying to install the Gains package in R Studio Version 3.1.2 like this:
install.packages("gains")
The following warnings appear:
InternetOpenUrl failed: 'The server name or address could not be resolved'
Warning in install.packages :unable to access index for repository http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.1
Warning in install.packages :package ‘gains’ is not available (for R version 3.1.2)
Does anyone know how can I fix this?
Thanks!
I believe that the problem lies in your corrupted, incomplete or otherwise incorrect R environment. I was able to install that package without any problems at all just by issuing the default command:
> install.packages("gains")
Installing package into ‘C:/Users/Alex/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/gains_1.1.zip'
Content type 'application/zip' length 35802 bytes (34 Kb)
opened URL
downloaded 34 Kb
package ‘gains’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\Alex\AppData\Local\Temp\RtmpSSRths\downloaded_packages
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
loaded via a namespace (and not attached):
[1] tools_3.1.1
As a quick solution to the problem, I suggest to specify CRAN mirror explicitly:
install.packages("gains", repos = "http://cran.rstudio.com")

Resources