Learn R Programming

flyio (version 0.1.4)

import_file: Download file from cloud to local system

Description

Save a single file from the cloud to your local drive

Usage

import_file(bucketpath, localfile, data_source = flyio_get_datasource(),
  bucket = flyio_get_bucket(data_source), overwrite = TRUE,
  show_progress = FALSE, ...)

Arguments

bucketpath

path of file in the bucket

localfile

path where the file needs to be downloaded. The file name and extension also need to be present; if not, the current file name will be considered

data_source

the name of the data source, if not set globally, gcs or s3

bucket

the name of the bucket, if not set globally

overwrite

logical. If the files should be overwritten if already present

show_progress

logical. Shows progress of the download operation

...

other parameters for gcs_get_object or save_object

Value

the filename and path of the object saved to local

Examples

Run this code
# NOT RUN {
# import data from GCS to Local
flyio_set_datasource("gcs")
flyio_set_bucket("your-bucket-name")
import_file("mtcars.csv", paste0(tempdir(), "/mtcars.csv"), overwrite = T)
# }

Run the code above in your browser using DataLab