Gets file ids from various inputs and marks them as such, to distinguish them from file names or paths.

This is a generic function.

as_id(x, ...)

Arguments

x

A character vector of file or shared drive ids or URLs, a dribble, or a suitable data frame.

...

Other arguments passed down to methods. (Not used.)

Value

A character vector bearing the S3 class drive_id.

Examples

as_id("123abc")
#> [1] "123abc"
#> attr(,"class")
#> [1] "drive_id"
as_id("https://docs.google.com/spreadsheets/d/qawsedrf16273849/edit#gid=12345")
#> [1] "qawsedrf16273849"
#> attr(,"class")
#> [1] "drive_id"

x <- drive_find(n_max = 3)
as_id(x)
#> [1] "1WA-F-sEbn010P4SZuDNKzFPTmbrv-Oj7" "1opPZyo4WUiue56qlF8SO5ipaTJwPLzZg"
#> [3] "1JCQ06Wj6AjntiyjnHsXmmcHZWCkBNgBJ"
#> attr(,"class")
#> [1] "drive_id"