/ R-Project

Accessing AWS S3 from R

I've been toying with a WebApp integration with R using OpenCPU.

The WebApp needs access to output files generated from R. I wanted to keep the R app and WebApp a little separated and hence thought that I could upload the output to S3 from R and then access the files from my WebApp.

I looked around and this package called cloudyr/aws.s3 worked well for me. Installation of the R package is straightforward using:

require("devtools")
install_github("cloudyr/aws.s3")

Once done, you can access S3 (assuming you've got the permissions right) using the functions described in the examples.

For e.g. listing the files as follows worked for me:


Sys.setenv("AWS_ACCESS_KEY_ID" = "XXXXXXXXX",
           "AWS_SECRET_ACCESS_KEY" = "yyyyyyyy",
           "AWS_DEFAULT_REGION" = "us-west-1")

library("aws.s3")

files <- get_bucket(bucket = 'meteor-dalalbeat')