download_button: Download local file

View source: R/download_button.R

download_buttonR Documentation

Download local file

Description

Save an object as RDS and create a download button that can be rendered to Rmarkdown HTML pages. Uses the package downloadthis.

Usage

download_button(
  object,
  save_output = FALSE,
  outfile_dir = NULL,
  filename = NULL,
  button_label = paste0("Download: ", "<code>", filename, "</code>"),
  output_extension = ".rds",
  icon = "fa fa-save",
  button_type = "success",
  self_contained = TRUE,
  add_download_button = TRUE,
  verbose = TRUE
)

Arguments

object

R object to serialize.

save_output

Default FALSE. If TRUE, all outputs (tables and plots) of the analysis will be saved in a folder (EpiCompare_file).

outfile_dir

Directory to save the file to.

filename

Name of the file to save.

button_label

Character (HTML), button label

output_extension

Extension of the output file. Currently, .csv, .xlsx, and .rds are supported. If a (named) list is passed to the function, only .xlsx and .rds are supported.

icon

Fontawesome tag e.g.: "fa fa-save"

button_type

Character, one of the standard Bootstrap types

self_contained

A boolean to specify whether your HTML output is self-contained. Default to FALSE.

add_download_button

Add download buttons for each plot or dataset.

verbose

Print messages.

Value

Download button as HTML text.

Source

csv2 Issue.

Plotly Issue

Examples

button <- download_button(object=mtcars)

serachoi1230/EpiCompare documentation built on Jan. 30, 2024, 11:37 a.m.