简体   繁体   中英

Unable to install dplyr on R-4.0.5

Trying to install dplyr on R-4.0.5

When I do install.packages("dplyr") ,

I get the following error,

Installing package into ‘C:/Users/Pragyaditya Das/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘purrr’, ‘generics’, ‘tidyselect’


  There is a binary version available but the source version is later:
      binary source needs_compilation
dplyr  1.0.5  1.0.6              TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/purrr_0.3.4.zip'
Content type 'application/zip' length 429582 bytes (419 KB)
downloaded 419 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/generics_0.1.0.zip'
Content type 'application/zip' length 71044 bytes (69 KB)
downloaded 69 KB

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/tidyselect_1.1.1.zip'
Content type 'application/zip' length 204234 bytes (199 KB)
downloaded 199 KB

package ‘purrr’ successfully unpacked and MD5 sums checked
package ‘generics’ successfully unpacked and MD5 sums checked
package ‘tidyselect’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\Pragyaditya Das\AppData\Local\Temp\RtmpOAwWYv\downloaded_packages
installing the source package ‘dplyr’

trying URL 'https://cran.rstudio.com/src/contrib/dplyr_1.0.6.tar.gz'
Content type 'application/x-gzip' length 954401 bytes (932 KB)
downloaded 932 KB

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

*** arch - i386
"c:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"C:/PROGRA~1/R/R-40~1.5/include" -DNDEBUG          -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c chop.cpp -o chop.o
sh: c:/rtools40/mingw32/bin/g++: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:229: chop.o] Error 127
ERROR: compilation failed for package 'dplyr'
* removing 'C:/Users/Pragyaditya Das/Documents/R/win-library/4.0/dplyr'
Warning in install.packages :
  installation of package ‘dplyr’ had non-zero exit status

The downloaded source packages are in
    ‘C:\Users\Pragyaditya Das\AppData\Local\Temp\RtmpOAwWYv\downloaded_packages’

Please help me. TIA.

I solved the problem by naming the default Rtools installation folder and ming_w32 folders as the installer was searching.

So, changes done were:

Rename Rtools as rtools40 & Rename ming_w32 as mingw32 in the root folder of RTools installation.

This solved the issue.

More specifically, rename C:\RTools to C:\RTools40 and rename C:\Rtools40\ming_w64 to C:\Rtools40\mingw64 (not sure this is necessary since the root folder is already renamed)

After these changes, I was able to install the dplyr package and load the library.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM