drive_rename | R Documentation |
This is a wrapper for drive_mv()
that only renames a file.
If you would like to rename AND move the file, see drive_mv()
.
drive_rename(file, name = NULL, overwrite = NA, verbose = deprecated())
An object of class dribble
, a tibble with one row per file.
# Create a file to rename
file <- drive_create("file-to-rename")
# Rename it
file <- drive_rename(file, name = "renamed-file")
# `overwrite = FALSE` errors if something already exists at target filepath
# THIS WILL ERROR!
drive_create("name-squatter-rename")
drive_rename(file, name = "name-squatter-rename", overwrite = FALSE)
# `overwrite = TRUE` moves the existing item to trash, then proceeds
file <- drive_rename(file, name = "name-squatter-rename", overwrite = TRUE)
# Clean up
drive_rm(file)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.