Created
June 20, 2015 12:21
-
-
Save duxan/2cd638e0a026300977c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. set WD | |
setwd("C:/Users/Core-i5/Desktop/dataSci/3 Getting data/W3") # NOTE: change this PATH | |
# 2. make folder | |
if(!file.exists("./data")){ | |
dir.create("./data") | |
} | |
# 3. make handle | |
fileURL <- "https://github.com/DataScienceSpecialization/courses/blob/master/03_GettingData/dplyr/chicago.rds?raw=true" | |
# 4. download data | |
download.file(fileURL, destfile = "./data/chicago.rds", method = "curl", extra='-L') | |
# 5. read data | |
chicago <- readRDS("./data/chicago.rds") |
Thanks ,duxan
Yes,when using the
http://stackoverflow.com/questions/29814405/why-do-i-need-to-use-mode-wb-with-download-file-for-this-rds-file
it gives the right data ,and we can manipulate the Data with dplyr nicely and smoothly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this alternative/addition!
It seems that RDS is binary file and in my case it was recognized as such by default. But it is not something to rely on, as suggested here: http://stackoverflow.com/questions/29814405/why-do-i-need-to-use-mode-wb-with-download-file-for-this-rds-file