Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts/2022-08-04-how-to-use-quarto-for-parameterized-reporting/ #10

Open
utterances-bot opened this issue Oct 8, 2022 · 8 comments
Open

Comments

@utterances-bot
Copy link

Mike Mahoney - How to use Quarto for Parameterized Reporting

You know. If you wanna.

https://www.mm218.dev/posts/2022-08-04-how-to-use-quarto-for-parameterized-reporting/

Copy link

Any advise for using parameters with Python code used in a Quarto report? Is this possible?

@mikemahoney218
Copy link
Owner

Hey @marierivers ! Yes! I'm going to steal from the official Quarto docs here, because I don't use the Juypter engines that often: https://quarto.org/docs/computations/parameters.html#jupyter

From the docs:
For Jupyter, Quarto uses the same syntax for defining parameters as Papermill. To parameterize a notebook, designate a cell with the tag parameters and provide appropriate default values:

#| tags: [parameters]

alpha = 0.1
ratio = 0.1

The parameters are available in the top level environment:

str(alpha)

Copy link

pelld commented Feb 10, 2023

Excellent guide, very helpful.
I'd like to produce multiple HTML files but how can I name them using parameters?

@mikemahoney218
Copy link
Owner

I'm not immediately sure, @pelld ! If you ask over at https://github.com/quarto-dev/quarto-cli/discussions they might be able to help.

Copy link

ssinari commented Feb 22, 2023

@pelld You might use quarto_render command as shown in this stackoverflow discussion:
https://stackoverflow.com/questions/73588271/customizing-r-quarto-pdf-output-file-name

The same post also shows more output file naming options.

Copy link

This was far more entertaining than it had any right to be! Parameterized SQL looks very interesting, thanks for sharing this.

Copy link

KilemiD commented Jun 15, 2023

Thank you Mike. I enjoyed reading this. My problem, which ultimately led me here is to render customized reports for a number of say health facilities without doing a single report for each. Any advice on how I would actually execute that? I am thinking params is the way to go, but may you could shed more light on how I would execute that?

Copy link

akins11 commented May 14, 2024

Thank you so much, This was incredibly helpful and much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants