4

after a fresh (Control panel, Windows 7) uninstall, then re-install of Rstudio, I have tried to install and load tidyverse. I get the following message, seemingly because the package DBI is missing:

install.packages("tidyverse") Installing package into ‘C:/Users/jshea/Documents/R/win-library/3.3’ (as ‘lib’ is unspecified) trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/tidyverse_1.1.1.zip' Content type 'application/zip' length 41994 bytes (41 KB) downloaded 41 KB package ‘tidyverse’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in C:\Users\jshea\AppData\Local\Temp\1\RtmpmoPd5V\downloaded_packages

library(tidyverse) Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘DBI’ Error: package or namespace load failed for ‘tidyverse’

Earlier this morning, when I did this the first time, the system seemed to download all the packages except there was some kind of error associated with DBI- I think a database package. Even uninstalling and deleting obvious remnants of Rstudio does not seem to give me a clean base to fix this. What can I do?

jshea
  • 41
  • 1
  • 1
  • 2
  • welcome to data science SE! If you read the error message carefully you will see that you are missing the DBI package. This has nothing to do with RStudio. – Stereo Mar 16 '17 at 10:04

1 Answers1

8

It sounds like you do not have a dependency installed which tidyverse needs to run correctly.

Usually dependencies install with the package, but at times you need to coerce them to do so, so I usually install with the coercion for all packages.

install.packages("tidyverse", dependencies=TRUE)

In this case, if that was the only error, or you installed in this manner and did not get DBI, then I would just install it directly:

install.packages("DBI", dependencies=TRUE)

Once you have done that, if you are still having problems, explicitly load DBI:

require(DBI) or library(DBI)

and you should be good to go.

If you have a problem still, comment and I will try to help you chase it down.

sconfluentus
  • 596
  • 3
  • 6