@@ -112,9 +112,9 @@ files by name (path, really) or by Drive file id using `drive_get()`.
112
112
(x <- drive_get(" ~/abc/def/googledrive-NEWS.md" ))
113
113
# > ✔ The input `path` resolved to exactly 1 file.
114
114
# > # A dribble: 1 × 4
115
- # > name path id drive_resource
116
- # > <chr> <chr> <drv_id> <list>
117
- # > 1 googledrive-NEWS.md ~/abc/def/googledrive-NEWS.md 1h1lhFfQrDZe … <named list>
115
+ # > name path id drive_resource
116
+ # > <chr> <chr> <drv_id> <list>
117
+ # > 1 googledrive-NEWS.md ~/abc/def/googledrive-NEWS.md 1h1lhFf … <named list [41] >
118
118
```
119
119
120
120
` as_id() ` can be used to convert various inputs into a marked vector of
@@ -155,15 +155,15 @@ We can upload any file type.
155
155
" index-chicken.csv"
156
156
))
157
157
# > Local file:
158
- # > • '/private/tmp/RtmpiLJKwa/temp_libpath39ea21793ac /googledrive/extdata/example_files/chicken.csv'
158
+ # > • '/private/tmp/Rtmpk4twsE/temp_libpath10e8b70beb6a9 /googledrive/extdata/example_files/chicken.csv'
159
159
# > Uploaded into Drive file:
160
- # > • 'index-chicken.csv' <id: 11Qt438Qei_SPbBpQQmukIel1lqlN5rkt >
160
+ # > • 'index-chicken.csv' <id: 1dE2U3TUvYulwE88ucBPQHP0-CB4zEK7P >
161
161
# > With MIME type:
162
162
# > • 'text/csv'
163
163
# > # A dribble: 1 × 3
164
164
# > name id drive_resource
165
165
# > <chr> <drv_id> <list>
166
- # > 1 index-chicken.csv 11Qt438Qei_SPbBpQQmukIel1lqlN5rkt <named list [41]>
166
+ # > 1 index-chicken.csv 1dE2U3TUvYulwE88ucBPQHP0-CB4zEK7P <named list [41]>
167
167
```
168
168
169
169
Notice that file was uploaded as ` text/csv ` . Since this was a ` .csv `
@@ -174,7 +174,7 @@ Google Spreadsheet. Let’s delete this file first.
174
174
``` r
175
175
drive_rm(chicken )
176
176
# > File deleted:
177
- # > • 'index-chicken.csv' <id: 11Qt438Qei_SPbBpQQmukIel1lqlN5rkt >
177
+ # > • 'index-chicken.csv' <id: 1dE2U3TUvYulwE88ucBPQHP0-CB4zEK7P >
178
178
179
179
# example of using a dribble as input
180
180
chicken_sheet <- drive_example_local(" chicken.csv" ) %> %
@@ -183,9 +183,9 @@ chicken_sheet <- drive_example_local("chicken.csv") %>%
183
183
type = " spreadsheet"
184
184
)
185
185
# > Local file:
186
- # > • '/private/tmp/RtmpiLJKwa/temp_libpath39ea21793ac /googledrive/extdata/example_files/chicken.csv'
186
+ # > • '/private/tmp/Rtmpk4twsE/temp_libpath10e8b70beb6a9 /googledrive/extdata/example_files/chicken.csv'
187
187
# > Uploaded into Drive file:
188
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
188
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
189
189
# > With MIME type:
190
190
# > • 'application/vnd.google-apps.spreadsheet'
191
191
```
@@ -203,9 +203,9 @@ and parks more detailed metadata in a `permissions_resource` variable.
203
203
chicken_sheet %> %
204
204
drive_reveal(" permissions" )
205
205
# > # A dribble: 1 × 5
206
- # > name shared id drive_resource permissions_resource
207
- # > <chr> <lgl> <drv_id> <list> <list>
208
- # > 1 index-chicken-sheet FALSE 1ol2RLc9TmlMUg … <named list> <named list [2]>
206
+ # > name shared id drive_resource permissions_resource
207
+ # > <chr> <lgl> <drv_id> <list> <list>
208
+ # > 1 index-chicken-sheet FALSE 1KXgDfk … <named list [36]> <named list [2]>
209
209
```
210
210
211
211
Here’s how to grant anyone with the link permission to view this data
@@ -218,11 +218,11 @@ set.
218
218
# > • role = reader
219
219
# > • type = anyone
220
220
# > For file:
221
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
221
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
222
222
# > # A dribble: 1 × 5
223
- # > name shared id drive_resource permissions_resource
224
- # > <chr> <lgl> <drv_id> <list> <list>
225
- # > 1 index-chicken-sheet TRUE 1ol2RLc9TmlMUg … <named list> <named list [2]>
223
+ # > name shared id drive_resource permissions_resource
224
+ # > <chr> <lgl> <drv_id> <list> <list>
225
+ # > 1 index-chicken-sheet TRUE 1KXgDfk … <named list [37]> <named list [2]>
226
226
```
227
227
228
228
This comes up so often, there’s even a convenience wrapper,
@@ -240,9 +240,9 @@ variable.
240
240
chicken_sheet %> %
241
241
drive_reveal(" published" )
242
242
# > # A dribble: 1 × 7
243
- # > name published shared id drive_resource permissions_resource
244
- # > <chr> <lgl> <lgl> <drv > <list> <list>
245
- # > 1 index-chicken-sheet FALSE TRUE 1ol2 … <named list> <named list [2]>
243
+ # > name published shared id drive_resource permissions_resource
244
+ # > <chr> <lgl> <lgl> <drv_id > <list> <list>
245
+ # > 1 index-chicken-s… FALSE TRUE 1KXgDfk … <named list> <named list [2]>
246
246
# > # ℹ 1 more variable: revision_resource <list>
247
247
```
248
248
@@ -251,11 +251,11 @@ By default, `drive_publish()` will publish your most recent version.
251
251
``` r
252
252
(chicken_sheet <- drive_publish(chicken_sheet ))
253
253
# > File now published:
254
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
254
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
255
255
# > # A dribble: 1 × 7
256
- # > name published shared id drive_resource permissions_resource
257
- # > <chr> <lgl> <lgl> <drv > <list> <list>
258
- # > 1 index-chicken-sheet TRUE TRUE 1ol2 … <named list> <named list [2]>
256
+ # > name published shared id drive_resource permissions_resource
257
+ # > <chr> <lgl> <lgl> <drv_id > <list> <list>
258
+ # > 1 index-chicken-s… TRUE TRUE 1KXgDfk … <named list> <named list [2]>
259
259
# > # ℹ 1 more variable: revision_resource <list>
260
260
```
261
261
@@ -273,7 +273,7 @@ extension in `path`. For example, if I would like to download the
273
273
``` r
274
274
drive_download(" index-chicken-sheet" , type = " csv" )
275
275
# > File downloaded:
276
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
276
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
277
277
# > Saved locally as:
278
278
# > • 'index-chicken-sheet.csv'
279
279
```
@@ -287,7 +287,7 @@ drive_download(
287
287
overwrite = TRUE
288
288
)
289
289
# > File downloaded:
290
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
290
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
291
291
# > Saved locally as:
292
292
# > • 'index-chicken-sheet.csv'
293
293
```
@@ -301,7 +301,7 @@ Google Sheets, this is an Excel workbook:
301
301
``` r
302
302
drive_download(" index-chicken-sheet" )
303
303
# > File downloaded:
304
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
304
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
305
305
# > Saved locally as:
306
306
# > • 'index-chicken-sheet.xlsx'
307
307
```
@@ -336,7 +336,7 @@ file.remove(c(
336
336
# > [1] TRUE TRUE TRUE
337
337
drive_find(" index-chicken" ) %> % drive_rm()
338
338
# > File deleted:
339
- # > • 'index-chicken-sheet' <id: 1ol2RLc9TmlMUgrp-7lvchd_T2FuLFQq4y95-3itYJ0g >
339
+ # > • 'index-chicken-sheet' <id: 1KXgDfk3IfJg833XokFhKDahY9aDml-183NHPz3qXlAY >
340
340
```
341
341
342
342
## Privacy
0 commit comments