alexb523
alexb523

Reputation: 738

r - read zip file from s3 using r

Is it possible to read a zipped sas file (or any kind or file) from s3 using r?

Here is what I'm trying:

library(aws.s3)
library(haven)

s3read_using(FUN = read_sas(unzip(.)),
                   bucket = "s3://bucket/",
                   object = "file.zip") # and inside is a .sas7bdat file

but it's obviously not recognizing the .. I have not found any good info on reading a .zip file from s3

Upvotes: 2

Views: 1103

Answers (1)

Mehaboob Khan
Mehaboob Khan

Reputation: 363

I was trying to read the zip file from S3 and store it in the local Linux system. Maybe you can try this and then unzip the file and read.

library("aws.s3")
save_object("s3://mybucket/input/test.zip", file = "/home/test.zip", bucket = "mybucket")

Upvotes: 2

Related Questions