Cant load dplyr package

After trying to install a package from GitHub (to no avail and gave up); I tried to do other things. I found out I can't load the dplyr package anymore.

When I run library(dplyr), I get

Error: package or namespace load failed for ‘dplyr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘pillar’
In addition: Warning message:
package ‘dplyr’ was built under R version 3.6.3

After that I tried removing and reinstalling the "pillar" pacakge to no avail. My console:

remove.packages("pillar")

Removing package from ‘C:/Users/user/Documents/R/win-library/3(dot)6’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘pillar’

install.packages("pillar")

Installing package into ‘C:/Users/user/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
pillar 1.6.0 1.6.1 FALSE

installing the source package ‘pillar’

trying URL 'https://cran.rstudio.com/src/contrib/pillar_1.6.1.tar.gz'
Content type 'application/x-gzip' length 1111747 bytes (1.1 MB)
downloaded 1.1 MB

Warning in install.packages :
installation of package ‘pillar’ had non-zero exit status

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

library(pillar)

Error in library(pillar) : there is no package called ‘pillar’

I don't know what to do anymore. This is very frustrating. FYI, I'm using RStudio Version 1.4.1717.

This means the installation has failed

When asked, choose to install the binary version.

Also, you could update your R version so you can get the latest pillar version as a binary as well.

Hello there! Thanks for your prompt reply!

Sorry, but I can't follow. How do I do that? Cause I don't think R gives me an option when I run install.packages("pillar").

To my understanding, my R version is already the latest version.

When I go to Help -> Check for Updates, it says I'm already using the latest version of RStudio.
I also just ran install.packages("installr"), and then ran the following codes again:

remove.packages("pillar")
install.packages("pillar")
library(pillar)

and it just resulted in the same thing.

When both binary and source versions are available, R asks you if you want to install from source, if you answer "no" to this question, it installs the binary version.

You might be running the latest RStudio version but that is not the same as having the latest R version.
You have R 3.6 installed and the latest version is 4.1.0, you can download it from here

https://cran.r-project.org/bin/windows/

1 Like

Not exactly the same question but it's related:

How do I do this exactly?

Cause when I try install.packages("devtools"), I get

Installing package into ‘C:/Users/user/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
devtools 2.4.1 2.4.2 FALSE

installing the source package ‘devtools’

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

Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status

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

and idk how to select the source version.

As you probably would have guessed, when I run library(devtools), it says

Error in library(devtools) : there is no package called ‘devtools’

Do you have Rtools installed? It makes installing packages from binary less of a headache on windows machines.

This is weird, usually, you are asked to choose, but you can force R to prefer binaries by running this command before installing the package

options(pkgType="binary")
install.packages("devtools")

To clarify this for others reading this thread, RTools is a software that contains the necessary tools for compiling R packages and you need to have it installed in your system if you want to compile packages from source in Windows systems. It is not used when you install packages from precompiled binaries.

2 Likes

Yeah I did. Just to follow Rtools's guide, I ran Sys.which("make") and the console showed

                          make 

"C:\rtools40\usr\bin\make.exe"

but when I tried install.packages("jsonlite", type = "source"), I get

Installing package into ‘C:/Users/user/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/jsonlite_1.7.2.tar.gz'
Content type 'application/x-gzip' length 421716 bytes (411 KB)
downloaded 411 KB

Warning in install.packages :
installation of package ‘jsonlite’ had non-zero exit status

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

I'm not sure if this should be a concern. I ran...

and the binary installed sucessfully!

I'm not sure if I can continue asking this but I would like to run devtools::install_github("doomlab/MeMoBootR"), but as you can see below, it still fails. :sweat:

Downloading GitHub repo doomlab/MeMoBootR@HEAD
Installing 12 packages: colorspace, viridisLite, RColorBrewer, munsell, labeling, farver, scales, isoband, gtable, shape, ggplot2, diagram
Installing packages into ‘C:/Users/user/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/colorspace_2.0-1.zip'
Content type 'application/zip' length 2640934 bytes (2.5 MB)
downloaded 2.5 MB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/viridisLite_0.4.0.zip'
Content type 'application/zip' length 1299475 bytes (1.2 MB)
downloaded 1.2 MB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/RColorBrewer_1.1-2.zip'
Content type 'application/zip' length 55593 bytes (54 KB)
downloaded 54 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/munsell_0.5.0.zip'
Content type 'application/zip' length 244972 bytes (239 KB)
downloaded 239 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/labeling_0.4.2.zip'
Content type 'application/zip' length 62808 bytes (61 KB)
downloaded 61 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/farver_2.1.0.zip'
Content type 'application/zip' length 1752105 bytes (1.7 MB)
downloaded 1.7 MB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/scales_1.1.1.zip'
Content type 'application/zip' length 563213 bytes (550 KB)
downloaded 550 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/isoband_0.2.4.zip'
Content type 'application/zip' length 3062282 bytes (2.9 MB)
downloaded 2.9 MB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/gtable_0.3.0.zip'
Content type 'application/zip' length 434074 bytes (423 KB)
downloaded 423 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/shape_1.4.6.zip'
Content type 'application/zip' length 789210 bytes (770 KB)
downloaded 770 KB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/ggplot2_3.3.3.zip'
Content type 'application/zip' length 4070136 bytes (3.9 MB)
downloaded 3.9 MB

trying URL 'https|COLON|//cran.rstudio.com/bin/windows/contrib/4.1/diagram_1.6.5.zip'
Content type 'application/zip' length 682763 bytes (666 KB)
downloaded 666 KB

package ‘colorspace’ successfully unpacked and MD5 sums checked
package ‘viridisLite’ successfully unpacked and MD5 sums checked
package ‘RColorBrewer’ successfully unpacked and MD5 sums checked
package ‘munsell’ successfully unpacked and MD5 sums checked
package ‘labeling’ successfully unpacked and MD5 sums checked
package ‘farver’ successfully unpacked and MD5 sums checked
package ‘scales’ successfully unpacked and MD5 sums checked
package ‘isoband’ successfully unpacked and MD5 sums checked
package ‘gtable’ successfully unpacked and MD5 sums checked
package ‘shape’ successfully unpacked and MD5 sums checked
package ‘ggplot2’ successfully unpacked and MD5 sums checked
package ‘diagram’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\user\AppData\Local\Temp\Rtmpch3Yvc\downloaded_packages
Error: Failed to install 'MeMoBootR' from GitHub:
System command 'Rcmd.exe' failed, exit status: -1, stdout + stderr empty

Note: I replaced ":" with |COLON| in the above console output.

This topic was automatically closed 7 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.