Skip to content

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.

Usage

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"    
#> [4] "chicken.txt"     "imdb_latin1.csv" "r_about.html"   
#> [7] "r_logo.jpg"     
drive_examples_local("chicken") %>% basename()
#> [1] "chicken.csv" "chicken.jpg" "chicken.pdf" "chicken.txt"
drive_example_local("imdb")
#> [1] "/home/runner/work/_temp/Library/googledrive/extdata/example_files/imdb_latin1.csv"

drive_examples_remote()
#> # A dribble: 9 × 3
#>   name            id                                          drive_reso…¹
#>   <chr>           <drv_id>                                    <list>      
#> 1 chicken_doc     1X9pd4nOjl33zDFfTjw-_eFL7Qb9_g6VfVFDp1PPae… <named list>
#> 2 chicken_sheet   1SeFXkr3XdzPSuWauzPdN-XnaryOYmZ7sFiUF5t-wS… <named list>
#> 3 chicken.csv     1VOh6wWbRfuQLxbLg87o58vxJt95SIiZ7           <named list>
#> 4 chicken.jpg     1b2_ZjzgvrSw0hBMgn-rnEbjp3Uq0XTKJ           <named list>
#> 5 chicken.pdf     13OQcAo8hkh0Ja5Wxlmi4a8aNvPK7pDkO           <named list>
#> 6 chicken.txt     1wOLeWVRkTb6lDmLRiOhg9iKM7DlN762Y           <named list>
#> 7 imdb_latin1.csv 1YJSVa0LTaVtGrZ4eVXYrSQ4y50uFl5bw           <named list>
#> 8 r_about.html    1sfCT0zqDz3vpZZlv_4nFlhq2WMaKqjow           <named list>
#> 9 r_logo.jpg      1J4v-iyydf1Cad3GjDkGRrynauV9JFOyW           <named list>
#> # … with abbreviated variable name ¹​drive_resource
drive_examples_remote("chicken")
#> # A dribble: 6 × 3
#>   name          id                                           drive_resou…¹
#>   <chr>         <drv_id>                                     <list>       
#> 1 chicken_doc   1X9pd4nOjl33zDFfTjw-_eFL7Qb9_g6VfVFDp1PPae94 <named list> 
#> 2 chicken_sheet 1SeFXkr3XdzPSuWauzPdN-XnaryOYmZ7sFiUF5t-wSVU <named list> 
#> 3 chicken.csv   1VOh6wWbRfuQLxbLg87o58vxJt95SIiZ7            <named list> 
#> 4 chicken.jpg   1b2_ZjzgvrSw0hBMgn-rnEbjp3Uq0XTKJ            <named list> 
#> 5 chicken.pdf   13OQcAo8hkh0Ja5Wxlmi4a8aNvPK7pDkO            <named list> 
#> 6 chicken.txt   1wOLeWVRkTb6lDmLRiOhg9iKM7DlN762Y            <named list> 
#> # … with abbreviated variable name ¹​drive_resource
drive_example_remote("chicken_doc")
#> # A dribble: 1 × 3
#>   name        id                                           drive_resource
#>   <chr>       <drv_id>                                     <list>        
#> 1 chicken_doc 1X9pd4nOjl33zDFfTjw-_eFL7Qb9_g6VfVFDp1PPae94 <named list>