0

So, first off I tried using this function:

    ## Install packages
    #ipak function: install and loads multiple R packages
    packages<-c("ggplot2", "psych", "nlme", "pracma", "corrplot", "lattice", "R2HTML", "zoo", "psy", "dplyr")
    ##
    ipak<- function(pkg){
    new.pkg<-pkg[!(pkg %in% installed.packages()[, "Package"])]
    if(length(new.pkg))
    install.packages(new.pkg, dependencies=TRUE)
    sapply(pkg, requrie, character.only=TRUE) }
    ipak(packages)
    ##
    ## This looks in and loads the libraries
    for(pkg in packages) library(pkg, chracter.only=T)

seemed to install and load the packages with no problem. I normally am working with R in the lab so these packages are already installed and just get loaded but because of the virus I am doing work at home. So I don't get these issues normally in lab. I was running my script and came across an error saying that there was no package called dplyr.

So I went and checked my library to see - indeed all of the other packages are installed, just not dplyr.

I first try to install tidyverse in entirety using the install.package function. All get installed except dplyr.

I try installing dplyr separately using the install.package function and it appears to install. It looks like it is trying to create a random folder in win-lib since there is no path specified. Fine, as long as it's installed.

I try to load dplyr from my library..and I get the error "there is no package called 'dplyr'".

Uhm...ok? So I attempted to install via the package tab on RStudio. It, again, appears to work. But now when I try to load the library I get an error reading "there is no package called 'purrr'" but nowhere in my code am I trying to install something called purrr..

What's going on? I'm using the most current version of R, or so I believe. Just having a problem troubleshooting this. EDIT: I see, purrr is a dependency. Any reason why this is the only one not installing?

EDIT: output of install.packages("dplyr") reads:

https://cran.rstudio.com/bin/windows/Rtools/

Installing package into 'C:/Users/Mona/Documents/R/win-library/3.6'

(as 'lib' is unspecified)

output of installed.packages("dplyr"):

Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License License_is_FOSS License_restricts_use OS_type Archs MD5sum NeedsCompilation Built

  • can you post the output of : installed.packages("dplyr") – user12256545 Mar 30 '20 at 18:31
  • I added the output as an edit to the question. –  Mar 30 '20 at 18:37
  • 1
    please try installed.packages() not install.packages() to check the status – user12256545 Mar 30 '20 at 18:39
  • Ok, it's added as another edit. sorry about that. –  Mar 30 '20 at 18:44
  • 2
    Looks like you don't have the tool needed to build the latest version from source. Select `No` when R asks if you want to compile from source. R will install the latest (all ready compiled) binary available – Tung Mar 30 '20 at 18:49
  • 1
    You need `RTools` to compile from source. See this https://stackoverflow.com/a/50278862/786542 – Tung Mar 30 '20 at 18:50
  • thanks for the tip. I installed RTools. doesn't seem to be compiling still. Getting the same error of purrr not being found. Other than that dplyr seems to install, it just won't load without purrr. EDIT: installed devtools, works. used find_rtools(), comes back with TRUE. Not sure what step I'm missing here. Puzzled by this. –  Mar 30 '20 at 19:17
  • Figured it out! Working as normal now, thank you much for the help. –  Apr 03 '20 at 00:26

0 Answers0