googledrive makes a variety of example files – both local and remote – available for use in examples and reprexes. These functions help you access the example files. See vignette("example-files", package = "googledrive") for more.

drive_examples_local(matches)

drive_examples_remote(matches)

drive_example_local(matches)

drive_example_remote(matches)

Arguments

matches

A regular expression that matches the name of the desired example file(s). This argument is optional for the plural forms (drive_examples_local() and drive_examples_remote()) and, if provided, multiple matches are allowed. The single forms (drive_example_local() and drive_example_remote()) require this argument and require that there is exactly one match.

Value

  • For drive_example_local() and drive_examples_local(), one or more local filepaths.

  • For drive_example_remote() and drive_examples_remote(), a dribble.

Examples

drive_examples_local() %>% basename()
#> [1] "chicken.csv"     "chicken.jpg"     "chicken.pdf"     "chicken.txt"    
#> [5] "imdb_latin1.csv" "r_about.html"    "r_logo.jpg"     
drive_examples_local("chicken") %>% basename()
#> [1] "chicken.csv" "chicken.jpg" "chicken.pdf" "chicken.txt"
drive_example_local("imdb")
#> [1] "/tmp/RtmpBqHrIi/temp_libpath9e4aa3f4f7225/googledrive/extdata/example_files/imdb_latin1.csv"

if (FALSE) { # drive_has_token()
drive_examples_remote()
drive_examples_remote("chicken")
drive_example_remote("chicken_doc")
}