getDocs             package:RGoogleDocs             R Documentation

_G_e_t _a _l_i_s_t _o_f _a_v_a_i_l_a_b_l_e _d_o_c_u_m_e_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     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 <URL:
     http://code.google.com/apis/gdata/docs/2.0/reference.html#Queries>{categories}
     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.

_U_s_a_g_e:

     getDocs(curl = getConnection(auth), folders = TRUE,
              as.data.frame = FALSE, auth, 
               what = "http://docs.google.com/feeds/documents/private/full", ...)

_A_r_g_u_m_e_n_t_s:

    curl: the authenticated connection to the Google Docs account

 folders: logical value indicating whether to include folders in the 
          list of documents.

as.data.frame: a logical value indicating whether to return the
          information about each document  as a row in a data frame or
          as individual 'GoogleDocument' objects.

    auth: authentication token obtained from calling 'getGoogleAuth'
          which can be used to initialize a Curl handle to use as the
          connection.

    what: 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'.

_V_a_l_u_e:

     A list of 'GoogleDocument' objects or a data frame.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_S_e_e _A_l_s_o:

     'getGoogleDocsConnection' 'searchDocs'

_E_x_a_m_p_l_e_s:

     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

       con = getGoogleDocsConnection("me", "password", service = "wise")
       getDocs(con)  # just the spreadsheets

         # Get just the word processing documents, i.e. not the spreadsheets, 
       d = getDocs(con, what = "http://docs.google.com/feeds/documents/private/full/-/document")
         # The above should be slightly faster than doing the subsetting in R.
       d = getDocs(con)
       d[sapply(d, is, "GoogleDocument")]

       spreadsheetsDocs = getDocs(con, what = "http://docs.google.com/feeds/documents/private/full/-/spreadsheet")

          # Get the starred spreadsheets
       starredSheets = getDocs(con, what = "http://docs.google.com/feeds/documents/private/full/-/spreadsheet/starred")

           # documents within the directory named MyDir
        o = getDocs(con, what = "http://docs.google.com/feeds/documents/private/full/-/MyDir")

     }

