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_reomote() 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] "/home/runner/work/_temp/Library/googledrive/extdata/example_files/imdb_latin1.csv"

drive_examples_remote()
#> # A dribble: 9 × 3
#>   name            id                                           drive_resource   
#>   <chr>           <drv_id>                                     <list>           
#> 1 chicken_doc     1X9pd4nOjl33zDFfTjw-_eFL7Qb9_g6VfVFDp1PPae94 <named list [31]>
#> 2 chicken_sheet   1SeFXkr3XdzPSuWauzPdN-XnaryOYmZ7sFiUF5t-wSVU <named list [31]>
#> 3 chicken.csv     1VOh6wWbRfuQLxbLg87o58vxJt95SIiZ7            <named list [35]>
#> 4 chicken.jpg     1b2_ZjzgvrSw0hBMgn-rnEbjp3Uq0XTKJ            <named list [37]>
#> 5 chicken.pdf     13OQcAo8hkh0Ja5Wxlmi4a8aNvPK7pDkO            <named list [36]>
#> 6 chicken.txt     1wOLeWVRkTb6lDmLRiOhg9iKM7DlN762Y            <named list [36]>
#> 7 imdb_latin1.csv 1YJSVa0LTaVtGrZ4eVXYrSQ4y50uFl5bw            <named list [35]>
#> 8 r_about.html    1sfCT0zqDz3vpZZlv_4nFlhq2WMaKqjow            <named list [36]>
#> 9 r_logo.jpg      1J4v-iyydf1Cad3GjDkGRrynauV9JFOyW            <named list [37]>
drive_examples_remote("chicken")
#> # A dribble: 6 × 3
#>   name          id                                           drive_resource   
#>   <chr>         <drv_id>                                     <list>           
#> 1 chicken_doc   1X9pd4nOjl33zDFfTjw-_eFL7Qb9_g6VfVFDp1PPae94 <named list [31]>
#> 2 chicken_sheet 1SeFXkr3XdzPSuWauzPdN-XnaryOYmZ7sFiUF5t-wSVU <named list [31]>
#> 3 chicken.csv   1VOh6wWbRfuQLxbLg87o58vxJt95SIiZ7            <named list [35]>
#> 4 chicken.jpg   1b2_ZjzgvrSw0hBMgn-rnEbjp3Uq0XTKJ            <named list [37]>
#> 5 chicken.pdf   13OQcAo8hkh0Ja5Wxlmi4a8aNvPK7pDkO            <named list [36]>
#> 6 chicken.txt   1wOLeWVRkTb6lDmLRiOhg9iKM7DlN762Y            <named list [36]>
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 [31]>