2

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

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
alexb523
  • 718
  • 2
  • 9
  • 26

1 Answers1

1

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")
Mehaboob Khan
  • 343
  • 1
  • 5
  • 18