s3_get {s3}R Documentation

download s3 file

Description

Files are downloaded to the R user data directory (i.e., tools::R_user_dir("s3", "data")) so they can be cached across all of an R user's sessions and projects. Specify an alternative download location by setting the R_USER_DATA_DIR environment variable (see ?tools::R_user_dir).

Usage

s3_get(
  s3_uri,
  region = "us-east-2",
  quiet = FALSE,
  progress = FALSE,
  force = FALSE,
  public = FALSE
)

Arguments

s3_uri

URI for an S3 object

region

AWS region for bucket containing the file (defaults to "us-east-2", but only required for private files)

quiet

suppress messages?

progress

show download progress? (currently only for public objects)

force

force download to overwrite existing S3 object

public

defaults to FALSE; if TRUE, ignore any environment variables specifying AWS credentials and attempt to download the file as publicly available

Value

a character string that is the file path to the downloaded file (invisibly)

Examples


the_file <- s3_get(s3_uri = "s3://geomarker/testing_downloads/mtcars.rds")
s3_get("s3://geomarker/testing_downloads/mtcars.rds") |>
    readRDS()
unlink(the_file)


[Package s3 version 1.0.0 Index]