Install.packages problem

package-installation

#1

Hello,

I recently installed R and RStudio on my mac and am having trouble installing packages such as "tidyverse". In contrast, I am able to download packages such as "forecast". I would greatly appreciate some guidance! Please see below on my R console output:

> install.packages("tidyverse")
also installing the dependencies ‘tibble’, ‘dbplyr’


  There are binary versions available but the source versions are later:
          binary source needs_compilation
tibble     1.3.4  1.4.2              TRUE
dbplyr     1.1.0  1.2.2             FALSE
tidyverse  1.1.1  1.2.1             FALSE

Do you want to install from sources the package which needs compilation?
y/n: n
trying URL 
Content type 'application/x-gzip' length 351939 bytes (343 KB)
==================================================
downloaded 343 KB


The downloaded binary packages are in
	/var/folders/xx/f9pjfxts2h989rkpdn7c26j40000gn/T//RtmpWXxlVd/downloaded_packages
installing the source packages ‘dbplyr’, ‘tidyverse’

trying URL 
Content type 'application/x-gzip' length 263687 bytes (257 KB)
==================================================
downloaded 257 KB

trying URL 
Content type 'application/x-gzip' length 61647 bytes (60 KB)
==================================================
downloaded 60 KB

* installing *source* package ‘dbplyr’ ...
** package ‘dbplyr’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace ‘tibble’ 1.3.4 is already loaded, but >= 1.4.1 is required
ERROR: lazy loading failed for package ‘dbplyr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/dbplyr’
Warning in install.packages :
  installation of package ‘dbplyr’ had non-zero exit status
ERROR: dependency ‘dbplyr’ is not available for package ‘tidyverse’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/xx/f9pjfxts2h989rkpdn7c26j40000gn/T/RtmpWXxlVd/downloaded_packages’
> library(tidyverse)
Error in library(tidyverse) : there is no package called ‘tidyverse’

#2

Try updating your packages before installing tidyverse.

update.packages ()
# this will update all your packages
install.packages ("tidyverse")

Hth


#3

You do not have the correct version of tibble installed. It should have been installed with tidyverse but there is something off because it only has propose you install from source and you said no.

The binary should have been available on cran.

You could try again changing the repo : install.packages("tidyverse", repos = "https://cloud.r-project.org")
Or you can also say yes to the question if you have the correct tools for compilation on your computer.


#4

For some reason I remember answering yes not working either in the past, but I was able to install the package successfully this time by replying yes. I did receive a conflict message (per below), but I think everything is working fine! Thank you both for helping.

── Conflicts ──────────────────────────────────────────────────── tidyverse_conflicts() ──
:heavy_multiplication_x: dplyr::filter() masks stats::filter()
:heavy_multiplication_x: dplyr::lag() masks stats::lag()


#5

Yes this conflict message is a reminder that, while you load tidyverse, some base function will be hidden by their tidyverse counterpart, and that you'll need to call then directly, with their namespace, to use them if needed: stats::filter() and stats::lag()