Let user download a file created in a code chunk

Hi all,

Is it possible to let the readers of an HTML document created by Quarto to download a file created in a code chunk?

Suppose I add embed-resources: true, and add the following:

dat <- data.frame(x = 1:5, y = 11:15)
write.csv(dat, "dat.csv")

Then, somewhere in the document, I want to add a link so readers cam download the embedded data CSV file.

Is it possible?

-- Shu Fai

CRAN - Package downloadthis (r-project.org)

2 Likes

It is exactly what I need! Thanks a lot, @martin.R ! :smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.