DS4PS / cpp-526-spr-2020

Course shell for CPP 526 Foundations of Data Science I for Spring 2020.
http://ds4ps.org/cpp-526-spr-2020/
3 stars 0 forks source link

Accessing the "cities.RData" dataset #30

Open andresjgonzalez6 opened 4 years ago

andresjgonzalez6 commented 4 years ago

In the video Week 6: Joining Data with dplyr, a new dataset was called that we have not used before. How do I gain access to it to follow along with the video?

I called the command in R-

load("cities.RData")

Then the console gives me this error message -

load("cities.RData") Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection In addition: Warning message: In readChar(con, 5L, useBytes = TRUE) : cannot open compressed file 'cities.RData', probable reason 'No such file or directory'

Where do I go to download this dataset? According to the error code, the computer is looking for a file directory that does not exist.

jamisoncrawford commented 4 years ago

I actually just created these from scratch! Just wanted to make something that was easy to demonstrate dplyr join functions. You can create these, as well, with the following code:

largest_cities <- 
  data.frame(city = c("New York City", "Los Angeles", 
                      "Chicago", "Houston", "Phoenix"),
             state = c("NY", "CA", "IL", "TX", "AZ"),
             pop = c(8601186, 4057841, 2679044, 
                     2359480, 1711356))

expensive_cities <-
  data.frame(city = c("New York City", "San Francisco",
                      "Honolulu", "Boston", "Washington"),
             avg_home_cost = c(779000, 1299000, 820000,
                               631997, 599900))

save.image("practice-cities.RData")

Since you can't attach these files in GitHub posts, I've uploaded them to this Google Drive folder if you'd like to download them! Cheers!