Last active
December 11, 2015 18:19
-
-
Save benmarwick/4640944 to your computer and use it in GitHub Desktop.
Use a google spreadsheet as data in R (with RCurl and options to support https)
This file contains hidden or 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
# More detail: http://blog.revolutionanalytics.com/2009/09/how-to-use-a-google-spreadsheet-as-data-in-r.html and | |
# http://exploredata.wordpress.com/2012/08/20/importing-a-google-spreadsheet-into-r/ | |
googsheet <- "full URL of google doc here, must end with &output=csv" | |
require(RCurl) | |
options(RCurlOptions = list(capath = system.file("CurlSSL", "cacert.pem", package = "RCurl"), ssl.verifypeer = FALSE)) | |
myCsv <- getURL(googsheet) | |
data <- read.csv(textConnection(myCsv), stringsAsFactors = FALSE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment