Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

drive_ls

List contents of a folder or Team Drive


Description

List the contents of a folder or Team Drive, recursively or not. This is a thin wrapper around drive_find(), that simply adds one constraint: the search is limited to direct or indirect children of path.

Usage

drive_ls(path = NULL, ..., recursive = FALSE)

Arguments

path

Specifies a single folder on Google Drive whose contents you want to list. Can be an actual path (character), a file id or URL marked with as_id(), or a dribble. If it is a Team Drive or is a folder on a Team Drive, it must be passed as a dribble.

...

Any parameters that are valid for drive_find().

recursive

Logical, indicating if you want only direct children of path (recursive = FALSE, the default) or all children, including indirect (recursive = TRUE).

Value

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

Examples

## Not run: 
## get contents of the folder 'abc' (non-recursive)
drive_ls("abc")

## get contents of folder 'abc' whose names contain the letters 'def'
drive_ls(path = "abc", pattern = "def")

## get all Google spreadsheets in folder 'abc'
## whose names contain the letters 'def'
drive_ls(path = "abc", pattern = "def", type = "spreadsheet")

## get all the files below 'abc', recursively, that are starred
drive_ls(path = "abc", q = "starred = true", recursive = TRUE)

## End(Not run)

googledrive

An Interface to Google Drive

v1.0.1
MIT + file LICENSE
Authors
Lucy D'Agostino McGowan [aut], Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.