add_download: Register a new download

Description Usage Arguments Details Value Author(s)

Description

Register a new download

Usage

1
2
add_download(x, label, writer = write.csv, description = "", ext = "csv",
  create = TRUE, ...)

Arguments

x

An object that should be made available for download. If this is a character vector of length one it is interpreted as the name of the object.

label

A short, descriptive label

writer

A function used to create the downloadable file from x. This function needs to take at least two arguments, the first of which should be the R object that is to be written to a file and the second of which should be the file name (without path).

description

A longer description.

ext

Extension to use for the file.

create

Logical indicating wether the downloadable file should be created immediately.

...

Additional arguments are passed to writer.

Details

If create is FALSE the downloadable file can be created later by a call to create_download. This allows objects to be registered for download when they are created while ensuring that they are not written to a file until any possible changes to their data have occured.

Value

Called for its side effect.

Author(s)

Peter Humburg


humburg/reportmd documentation built on May 17, 2019, 9:13 p.m.