cloud_drive_write_bulk {cloudfs} | R Documentation |
Write multiple objects to Google Drive in bulk
Description
This function allows for the bulk writing of multiple R objects
to the project's designated Google Drive folder. To prepare a list of
objects for writing, use cloud_object_ls, which generates a dataframe
listing the objects and their intended destinations in a format akin to the
output of cloud_drive_ls. By default, the function determines the
appropriate writing method based on each file's extension. However, if a
specific writing function is provided via the fun
parameter, it will be
applied to all files, which may not be ideal if dealing with a variety of
file types.
Usage
cloud_drive_write_bulk(
content,
fun = NULL,
...,
local = FALSE,
quiet = FALSE,
root = NULL
)
Arguments
content |
(data.frame) output of |
fun |
A custom writing function. If |
... |
Additional arguments to pass to the writing function |
local |
Logical, defaulting to |
quiet |
all caution messages may be turned off by setting this parameter
to |
root |
Google Drive ID or URL of the project root. This serves as the
reference point for all relative paths. When left as |
Value
Invisibly returns the input content
dataframe.
Examples
# write two csv files: data/df_mtcars.csv and data/df_iris.csv
cloud_object_ls(
dplyr::lst(mtcars = mtcars, iris = iris),
path = "data",
extension = "csv",
prefix = "df_"
) |>
cloud_drive_write_bulk()