I have set-up R on an EC2 Instance on AWS. I have few csv files uploaded into a S3 bucket. I was wondering if there is a way to access the csv files in the S3 bucket from R.
Any help/pointers would be appreciated.
Have a look at the cloudyr aws.s3
package (https://github.com/cloudyr/aws.s3), it might do what you need. Unfortunately (at time of writing), this package is quite early stage & a little unstable.
I've had good success simply using R's system()
command to make a call to the AWS CLI. This is relatively easy to get started on, very robust and very well supported.
So, for example, on command-line try following:
pip install awscli
aws configure
aws s3 help
aws s3api list-objects --bucket some-bucket --query 'Contents[].{Key: Key}'
aws s3api get-object --bucket some-bucket --key some_file.csv new_file_name.csv
In R, can just do something like:
system("aws s3api list-objects --bucket some-bucket --query 'Contents[].{Key: Key}' > my_bucket.json")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With