cfss-old / viz-brianp1

viz-brianp1 created by GitHub Classroom
0 stars 0 forks source link

Question about R #6

Open brianp1 opened 7 years ago

brianp1 commented 7 years ago

@bensoltoff

Hey Dr. Soltoff,

I went back to see if I could fix my final project to make the state tab actually appear. I ended up having to update R to the 3.4.0 version, and long story short, I can't seem to load packages and when I try to re-install them, I get an error (see below). The only information I could find was to install the R 3.4.0 patch. It allows me to install.packages using the GUI but RStudio still seems f'ed up.

When I try to install

> install.packages("tidyverse")
Warning in install.packages :
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES.rds': HTTP status was '404 Not Found'
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("ggmap")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("maps")
Warning in install.packages :
  cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/src/contrib/PACKAGES.rds': HTTP status was '404 Not Found'
Installing package into ‘C:/Users/brian/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed
Error in install.packages : Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed

Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed

My guess is that something is up with the CRAN where I am pulling from, but I am not completely sure.

This is what happens when I simply try to read in the library

> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘xml2’
> library(ggmap)
Loading required package: ggplot2
Error: package or namespace load failed for ‘ggmap’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘sp’

Again, I am not sure if this is just a bug on my system, or if this is an error in the updated version. I have only been able to find little information regarding these errors, and I was just wondering if you had any suggestions on what I should try.

Thanks,

Brian

bensoltoff commented 7 years ago

What OS are you using? Windows or Mac? You may be able to copy the folders containing the packages from the directory for R 3.3.x to the directory for R 3.4

brianp1 commented 7 years ago

Windows 10. I tried that, but it didn't seem to like it very much. I can try it again, though.

brianp1 commented 7 years ago

So, I moved the 3.3.x libraries to the 3.4, and I got these errors when I tried to install:

Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("ggmap")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("maps")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("mapdata")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("rvest")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("stringr")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("tilegramsR")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("sf")
Error in install.packages : missing value where TRUE/FALSE needed
> install.packages("leaflet")
Error in install.packages : missing value where TRUE/FALSE needed

and I got these when trying to load

> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘stringi’
> library(ggmap)
Loading required package: ggplot2
Use suppressPackageStartupMessages() to eliminate package startup messages.
Error: package or namespace load failed for ‘ggmap’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘sp’
> library(maps)
> library(mapdata)
> library(rvest)
Loading required package: xml2
> library(stringr)
Error: package or namespace load failed for ‘stringr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘stringi’
> library(tilegramsR)
Loading required package: sf
Linking to GEOS 3.5.0, GDAL 2.1.1, proj.4 4.9.3
> library(sf)
> library(leaflet)
Error: package or namespace load failed for ‘leaflet’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘digest’
> library(leaflet.extras)
Loading required package: leaflet
Error: package or namespace load failed for ‘leaflet’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
 there is no package called ‘digest’
Error: package ‘leaflet’ could not be loaded
> library(colormap)

I see that I am missing packages, but when I try to install them I get the error messages. Will try to install older versions

brianp1 commented 7 years ago

Ok, so things seem to be in order and working, but I am not exactly sure what I did this time to fix it, so I am still going to play with it, but thank you for the help.

bensoltoff commented 7 years ago

Haha, not a problem. Sometimes you just need to restart R and the problem mysteriously vanishes