Primary
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".xlsx",
button_label = "Download data as xlsx",
button_type = "primary",
has_icon = TRUE,
icon = "fa fa-save"
)This package provides a wrapper around bsplus::bs_button(), which has to goal to provide a download button in HTML outputs from R Markdown without the need to have runtime: shiny.
You can easily produce a download button as follows:
library(downloadthis)
mtcars %>%
download_this(
output_name = "mtcars dataset",
output_extension = ".csv",
button_label = "Download data as csv",
button_type = "default",
has_icon = TRUE,
icon = "fa fa-save"
).xlsx supported)list(mtcars, iris) %>%
download_this(
output_name = "mtcars and iris datasets",
output_extension = ".xlsx",
button_label = "Download datasets as xlsx",
button_type = "warning",
has_icon = TRUE,
icon = "fa fa-save"
).xlsx supported)list('mtcars dataset' = mtcars, 'iris dataset' = iris) %>%
download_this(
output_name = "mtcars and iris datasets",
output_extension = ".xlsx",
button_label = "Download datasets as xlsx",
button_type = "warning",
has_icon = TRUE,
icon = "fa fa-save"
)