download_dir: Download a directory

View source: R/download.R

download_dirR Documentation

Download a directory

Description

The path is converted into a .zip file.

Usage

download_dir(
  path,
  output_name,
  button_label = "Download data",
  button_type = c("default", "primary", "success", "info", "warning", "danger"),
  has_icon = TRUE,
  icon = "fa fa-save",
  self_contained = FALSE,
  ...
)

Arguments

path

Path to directory.

output_name

Name of of the output file.

button_label

Character (HTML), button label

button_type

Character, one of the standard Bootstrap types

has_icon

Specify whether to include fontawesome icons in the button label

icon

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

self_contained

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

...

attributes (named arguments) and children (unnamed arguments) of the button, passed to htmltools::tag().

Value

htmltools::tag, <button>

Examples

## Not run: 
## Directory path as an example
download_dir(
  path = system.file("assets", package = "downloadthis"),
  output_name = "example dir",
  button_label = "Download directory",
  button_type = "success",
  has_icon = TRUE,
  icon = "fa fa-save",
  self_contained = FALSE
)

## End(Not run)

downloadthis documentation built on Oct. 14, 2024, 5:07 p.m.