# NOT RUN {
# message: "Created Drive file"
(x <- drive_create("drive-quiet-demo", type = "document"))
# message: "File updated"
x <- drive_update(x, starred = TRUE)
drive_reveal(x, "starred")
# suppress messages for a small amount of code
with_drive_quiet(
x <- drive_update(x, name = "drive-quiet-works")
)
x$name
# message: "File updated"
x <- drive_update(x, media = drive_example_local("chicken.txt"))
# suppress messages within a specific scope, e.g. function
unstar <- function(y) {
local_drive_quiet()
drive_update(y, starred = FALSE)
}
x <- unstar(x)
drive_reveal(x, "starred")
# clean up
drive_rm(x)
# }
Run the code above in your browser using DataLab