board_gcs | R Documentation |
Pin data to a Google Cloud Storage bucket using the googleCloudStorageR package.
board_gcs(bucket, prefix = NULL, versioned = TRUE, cache = NULL)
bucket |
Bucket name. You can only write to an existing bucket, and you
can use |
prefix |
Prefix within this bucket that this board will occupy.
You can use this to maintain multiple independent pin boards within
a single GCS bucket. Will typically end with |
versioned |
Should this board be registered with support for versions? |
cache |
Cache path. Every board requires a local cache to avoid downloading files multiple times. The default stores in a standard cache location for your operating system, but you can override if needed. |
board_gcs()
is powered by the googleCloudStorageR package which provides
several authentication options, as documented in its
main vignette.
The two main options are to create a service account key (a JSON file) or an
authentication token; you can manage either using the gargle package.
The functions in pins do not create a new bucket. You can create
a new bucket from R with googleCloudStorageR::gcs_create_bucket()
.
You can pass arguments for googleCloudStorageR::gcs_upload such as
predefinedAcl
and upload_type
through the dots of pin_write()
.
board_gcs()
is powered by the googleCloudStorageR package, which is a
suggested dependency of pins (not required for pins in general). If
you run into errors when deploying content to a server like
https://www.shinyapps.io or Connect,
add requireNamespace("googleCloudStorageR")
to your app or document for automatic dependency discovery.
## Not run:
board <- board_gcs("pins-testing")
board %>% pin_write(mtcars)
board %>% pin_read("mtcars")
# A prefix allows you to have multiple independent boards in the same pin.
board_sales <- board_gcs("company-pins", prefix = "sales/")
board_marketing <- board_gcs("company-pins", prefix = "marketing/")
# You can make the hierarchy arbitrarily deep.
# Pass arguments like `predefinedAcl` through the dots of `pin_write`:
board %>% pin_write(mtcars, predefinedAcl = "publicRead")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.