Last chance! 50% off unlimited learning
Sale ends in
If the login and password are not specified in a call to either
function, we look for it in the option named
GoogleDocsPassword
. This should be a vector of length 2
giving the login and password, or alternatively a
named character vector of length 1 where the value is the password
and the name is the login.
If the option is not set, we look in
the environment variable
GOOGLE_DOCS_PASSWORD
. If this is set,
its value is used and should be in the form
login=value
.
getGoogleDocsConnection(..., auth, error = TRUE)
getGoogleAuth(login = getOption("GoogleDocsPassword"), password, service = "writely", appID = "R-GoogleDocs-0.1", error = TRUE)
getGoogleAuth
For "convenience", one can also pass the authentication token
returned from explicitly calling getGoogleAuth
.
getGoogleAuth
.login
TRUE
, to raise an error (i.e. call to
stop
or just return NULL
if error
is FALSE
.)
"GoogleSpreadsheetsConnection"
or "GoogleDocsConnection"
depending on which service was
requested - wise or writely, respectively.
This object is actually a Curl handle and can be used in subsequent HTTP
requests.
getGoogleAuth
if(exists("GoogleDocsPassword")) {
con = getGoogleDocsConnection(names(GoogleDocsPassword), GoogleDocsPassword)
# for all documents
con = getGoogleDocsConnection("dtemplelang@gmail.com", "my password")
# for spreadsheets
con = getGoogleDocsConnection("dtemplelang@gmail.com", "my password", "wise")
# Getting auth separately.
auth = getGoogleAuth("dtemplelang@gmail.com", "my password", "wise")
con = getGoogleDocsConnection(auth)
con = getGoogleDocsConnection(auth = auth)
}
Run the code above in your browser using DataLab