Learn R Programming

memoise (version 2.0.1)

cache_gcs: Google Cloud Storage Cache Google Cloud Storage backed cache, for remote caching.

Description

Google Cloud Storage Cache Google Cloud Storage backed cache, for remote caching.

Usage

cache_gcs(
  cache_name = googleCloudStorageR::gcs_get_global_bucket(),
  algo = "sha512",
  compress = FALSE
)

Arguments

cache_name

Bucket name for storing cache files.

algo

The hashing algorithm used for the cache, see digest for available algorithms.

compress

Argument passed to saveRDS. One of FALSE, "gzip", "bzip2" or "xz". Default: FALSE.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
library(googleCloudStorageR)
# Set GCS credentials.
Sys.setenv("GCS_AUTH_FILE"="<google-service-json>",
           "GCS_DEFAULT_BUCKET"="unique-bucket-name")

gcs <- cache_gcs("unique-bucket-name")
mem_runif <- memoise(runif, cache = gcs)
# }
# NOT RUN {

# }

Run the code above in your browser using DataLab