googledrive (version 0.0.0.9000)

drive_search: Search for files on Google Drive.

Description

This is the closest googledrive function to what you get from https://drive.google.com: by default, you just get a listing of your files. You can also narrow the search in various ways, such as by file type, whether it's yours or shared with you, starred status, etc.

Usage

drive_search(pattern = NULL, type = NULL, n_max = Inf, ...,
  verbose = TRUE)

Arguments

pattern

Character. If provided, only the files whose names match this regular expression are returned.

type

Character. If provided, only files of this type will be returned. Can be anything that drive_mime_type() knows how to handle. This is processed by googledrive and sent as a query parameter.

n_max

Integer. An upper bound on the number of files to return. This applies to the results returned by the API, which may be further filtered locally, via the pattern argument.

...

Query parameters to pass along to the API query.

verbose

Logical, indicating whether to print informative messages (default TRUE).

Value

An object of class dribble, a tibble with one row per file.

See Also

Helpful links for forming queries:

Examples

Run this code
# NOT RUN {
## list "My Drive" w/o regard for folder hierarchy
drive_search()

## search for files located directly in your root folder
drive_search(q = "'root' in parents")

## filter for folders
drive_search(type = "folder")
drive_search(q = "mimeType = 'application/vnd.google-apps.folder'")

## filter for Google Sheets
drive_search(type = "spreadsheet")
drive_search(q = "mimeType='application/vnd.google-apps.spreadsheet'")

## files whose names match a regex
drive_search(pattern = "jt")

## control page size or cap the number of files returned
drive_search(pageSize = 50)
drive_search(n_max = 75)
drive_search(pageSize = 5, n_max = 15)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab