aws.s3 (version 0.3.21)

s3source: Source from S3

Description

Source R code (a la source) from S3

Usage

s3source(object, bucket, ..., opts = NULL)

Arguments

object

Character string with the object key, or an object of class “s3_object”. In most cases, if object is specified as the latter, bucket can be omitted because the bucket name will be extracted from “Bucket” slot in object.

bucket

Character string with the name of the bucket, or an object of class “s3_bucket”.

Additional arguments passed to s3HTTP.

opts

Additional arguments passed to get_object for retrieving the R syntax file.

Value

See source

See Also

s3saveRDS,s3save, get_object

Examples

Run this code
# NOT RUN {
# create bucket
b <- put_bucket("myexamplebucket")

# save some code to the bucket
cat("x <- 'hello world!'\nx", file = "example.R")
put_object("example.R", object = "example.R", bucket = b)
get_bucket(b)

# source the code from the bucket
s3source(object = "example.R", bucket = b, echo = TRUE)

# cleanup
unlink("example.R")
delete_object(object = "example.R", bucket = b)
delete_bucket("myexamplebucket")
# }

Run the code above in your browser using DataCamp Workspace