15

I am trying to install dplyr package but got an error message saying

Error in library(dplyr) : there is no package called ‘dplyr’". 

I am using Windows and R i386 3.5.2. I tried to fix with install.packages("Rcpp") as suggested by others but still getting error message.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
xiongbenxiong
  • 187
  • 1
  • 1
  • 6

5 Answers5

13

Try install.packages("dplyr"), the double quote is important.

Dan
  • 11,370
  • 4
  • 43
  • 68
Mensch
  • 487
  • 7
  • 19
  • 4
    Well to be fair, you can also use single quotes;-) `install.packages('dplyr')`; the point here is that some functions accept non-standard evaluation (both `library(dplyr)` and `library("dplyr")` work) while others don't. – Maurits Evers Feb 10 '19 at 22:36
4

You dont have the package installed. To do that use : install.packages("dplyr")

Then library(dplyr)

2

this problem happened to me, too. The reason is that after you run "install.packages("dplyr")", the package installed in your R library (check here: C:\Program Files\R\R-3.5.1\library) is actually called "dbplyr".

So if you run library(dplyr), there should be no library under this name.

My solution is: turn off R studio, open it again. The run:

install.packages("Rcpp")
install.packages("dplyr")
Sara
  • 21
  • 1
  • Thanks for your solution. I ended up in a similar situation which I have to delete the folder "dplyr" and reinstall dplyr using `install.packages("dplyr")` – Marshall Dec 16 '19 at 18:29
  • dbplyr is an entirely separate (but related) package. I've been noticing "dplyr suddenly disappeared" pop up, and I'm still trying to figure out what's causing that. For me it happened when I upgraded R from 3.6.2 to 3.6.3, but I can't figure out yet why. – Jon Harmon Mar 08 '20 at 00:17
1

In my case, dplyr hadn't installed completely the first time I tried install.packages("dplyr") and, for some reason, refused to be overwritten when I tried to reinstall it. Manually deleting the dplyr folder and then reinstalling it worked for me. I just typed dplyr into the Windows start menu, which pulled up the correct folder in the R library, then I just hit right click and delete.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • This solved my problem. A suggestion on finding the folder, which is especially relevant if using `packrat`: type `.libPaths()` to find the possible locations the `dplyr` folder may be stored in for this particular project. – Christian Jan 10 '21 at 10:33
1

What I did to solve is, I removed the package 'dplyr'

remove.packages("dplyr")

then re-installed it again!

install.packages("dplyr")

then rather calling it this way,

library(dplyr)

I called this way,

library("dplyr")

and then did tried again without those quotations and it worked(I guess)!

desertnaut
  • 57,590
  • 26
  • 140
  • 166
An Android
  • 149
  • 1
  • 6