I'm having trouble installing the ggplot2 package in R. According to R-studio, I have the latest version installed; this is what it says when R studio first loads:
R version 3.2.2 (2015-08-14) -- "Fire Safety"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
I'm assuming this means I'm using the correct version. But then, when I try to install the ggplot2 package using the install.packages("ggplot2") command, I get the following error (had to post in pastebin because it contained links):
It appears to be some kind of error with my internet connection (not sure how to fix it, googling didn't seem to give a concrete answer). After I got that error, I went ahead and just tried downloading the .zip file for ggplot2 from the official CRAN website. Then, in R-Studio I went ahead and went to Tools>Install Packages and just installed it from the .zip. Then, in the console it said
> install.packages("C:/Users/ralei/Downloads/ggplot2_1.0.1.zip", repos = NULL, type = "win.binary")
Installing package into ‘C:/Users/ralei/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
package ‘ggplot2’ successfully unpacked and MD5 sums checked
But then when I call the ggplot2 library using the library(ggplot2) I get the error:
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘digest’
After going ahead and installing the 'digest' package (again through the CRAN website), I got another error when I tried to load ggplot2.
> library(ggplot2)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘gtable’
Error: package or namespace load failed for ‘ggplot2’
Can anybody explain to me what I'm doing wrong?
Thanks.
EDIT: This was marked as a duplicate to a "what to do if your package isn't available" error question but I don't see how my question is a duplicate of that -- I'm not getting the "package is unavailable" error since I can install it manually, but it seems that when I install ggplot2, the installation doesn't seem to 'stick'.