board_gcs: Use a Google Cloud Storage bucket as a board

View source: R/board_gcs.R

board_gcsR Documentation

Use a Google Cloud Storage bucket as a board


Pin data to a Google Cloud Storage bucket using the googleCloudStorageR package.


board_gcs(bucket, prefix = NULL, versioned = TRUE, cache = NULL)



Bucket name. You can only write to an existing bucket, and you can use googleCloudStorageR::gcs_get_global_bucket() here.


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 / to take advantage of Google Cloud Storage's directory-like handling.


Should this board be registered with support for versions?


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 or Connect, add requireNamespame(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)

pins documentation built on Jan. 22, 2023, 1:55 a.m.