Skip to content

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

Usage

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

Arguments

bucket

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

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

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.

Authentication

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.

Details

Examples

if (FALSE) {
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")
}