| publish | R Documentation |
Functions for publishing notebooks, data, and files to S3 storage.
Upload files or directories to an S3 bucket. This is the generic publishing
function - use publish_notebook() for Quarto documents or publish_data()
for data files.
publish(source, dest = NULL, connection = NULL, overwrite = TRUE)
source |
Character. Local file or directory path to upload. |
dest |
Character or NULL. Destination path in S3 bucket. If NULL, derives from source filename. |
connection |
Character or NULL. S3 connection name from config.yml.
If NULL, uses the connection marked with |
overwrite |
Logical. Whether to overwrite existing files. Default TRUE. |
Character. The public URL(s) of uploaded file(s).
if (FALSE) {
# Upload a single file
publish("outputs/report.html")
# -> https://bucket.s3.region.amazonaws.com/prefix/report.html
# Upload with custom destination
publish("outputs/report.html", dest = "reports/q4-2024.html")
# Upload a directory
publish("outputs/charts/", dest = "reports/charts/")
# Use specific connection
publish("data.csv", connection = "s3_backup")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.