Get a list of available documents

This function retrieves the list of available documents from the Google Docs account. Depending on the service specified when creating the connection and authenticating the login, the documents may be all document types or just the spreadsheets.

One can specify in the search via the what parameter. At present, you have to specify the full URL yourself rather than using more convenient R functionality and syntax.

getDocs(curl = getConnection(auth), folders = TRUE, = FALSE, auth = getGoogleAuth(service = service), what = GoogleURLs[service], ..., service = "writely")
the authenticated connection to the Google Docs account
logical value indicating whether to include folders in the list of documents.
a logical value indicating whether to return the information about each document as a row in a data frame or as individual GoogleDocument objects.
authentication token obtained from calling getGoogleAuth which can be used to initialize a Curl handle to use as the connection.
the type of documents to fetch, e.g. documents or spreadsheets. One can specify a value in GoogleURLs or use a name from this vector.
additional arguments passed to getURL.
the name of the Google Docs service, e.g. "wise" or "writely"

A list of GoogleDocument objects or a data frame.

See Also

getGoogleDocsConnection searchDocs

  • getDocs
if(exists("GoogleDocsPassword")) {
         # getGoogleDocsConnection("my login", "my password")
cat("Getting documents\n")
  con = getGoogleDocsConnection(names(GoogleDocsPassword), GoogleDocsPassword)

  getDocs(con)  # list of GoogleDocuments
  getDocs(con, TRUE) # a data frame

## Not run: 
#   con = getGoogleDocsConnection("me", "password", service = "wise")
#   getDocs(con)  # just the spreadsheets
# ## End(Not run)
    # Get just the word processing documents, i.e. not the spreadsheets, 
  d = getDocs(con, what = "")
    # The above should be slightly faster than doing the subsetting in R.
  d = getDocs(con)
  d[sapply(d, is, "GoogleDocument")]

  spreadsheetsDocs = getDocs(con, what = "")

     # Get the starred spreadsheets
  starredSheets = getDocs(con, what = "")

      # documents within the directory named MyDir
   o = getDocs(con, what = "")

Documentation reproduced from package RGoogleDocs, version 0.7-0, License: BSD

Community examples

Looks like there are no examples yet.