# NOT RUN {
library("datasets")
# create bucket
b <- put_bucket("myexamplebucket")
# save a dataset to the bucket as a csv
if (require("utils")) {
s3write_using(mtcars, FUN = write.csv, object = "mtcars.csv", bucket = b)
}
# load dataset from the bucket as a csv
if (require("utils")) {
s3read_using(FUN = read.csv, object = "mtcars.csv", bucket = b)
}
# cleanup
delete_object(object = "mtcars.csv", bucket = b)
delete_bucket(bucket = b)
# }
Run the code above in your browser using DataLab