You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure if this is the place to post this I have been working through your workshop code to teach myself Quarto. Mostly the videos and code are excellent and really helpful. However, I am getting different behavior from your code selecting params than was apparent from the video of your workshop. Specifically, I am using your 08-knitr/penguin-params.qmd file and the related code in render-params.R. I am working from within your quarto-workshop.Rproj with your directory structure.
I understand that a qmd file "sees" itself in the directory where it lives.
If I render penquin-params.qmd from within the document by (using the render button), it indeed creates an html file and supporting directory in the 08-knitr directory. Your cli code run from the terminal from the 08-knitr directory
(quarto render penguin-report.qmd -P species:Gentoo --output gentoo-report.html) also works as expected. As does your code
quarto::quarto_render("08-knitr/penguin-params.qmd").
However, things go off the rails when the output_file = argument is used in quarto_render, as in
quarto::quarto_render(
"08-knitr/penguin-params.qmd",
execute_params = list(species = "Gentoo"),
output_file = "Gentoo_report.html"
)
That code renders the Gentoo_report.html to the project root directory but puts the the supporting file directory in the 08-knitr directory. I have to manually copy the file to the intended directory to get the plot to show up. This is obviously non-functional when you scale up to something like the function you provide to walk through each species.
The function you provide in render-params.R in which you specify the directory in the output_file argument would be great, but it does not work for me. It generates the error
ERROR: --output option cannot specify a relative or absolute path
I have scoured the quarto-dev github issues and find this post, which makes me wonder how you got your function to work for you and all the workshop participants. quarto-dev/quarto-cli#2329
If I take the subdirectory out of the output_file argument of render_fun(), it creates the requested outputs for each species, but they are in the project root directory and the supporting files are in the 08-knitr directory. I see in some of the github chatter that I can set one output directory at the level of the project, but that is not useful. How are you getting the files into the desired subdirectory?
Again, apologies if this is not the right place to post these questions. I have spent a full day trying to figure this out on my own.
One other unrelated thing about your penguin-params.qmd - The way you calculate the number of observations for each species is backwards - you are actually reporting the number of penguins that are NOT the species included in the report. Also the heading for the figure is better given as - The distribution of body mass for the r params$species penguins are shown below.rather than just - The distribution for the r params$species penguins are shown below. I realize you were just showing examples of how to include such information but thought you would want the information to be accurate.
The text was updated successfully, but these errors were encountered:
Hi Tom -
I am not sure if this is the place to post this I have been working through your workshop code to teach myself Quarto. Mostly the videos and code are excellent and really helpful. However, I am getting different behavior from your code selecting params than was apparent from the video of your workshop. Specifically, I am using your 08-knitr/penguin-params.qmd file and the related code in render-params.R. I am working from within your quarto-workshop.Rproj with your directory structure.
I understand that a qmd file "sees" itself in the directory where it lives.
If I render penquin-params.qmd from within the document by (using the render button), it indeed creates an html file and supporting directory in the 08-knitr directory. Your cli code run from the terminal from the 08-knitr directory
(quarto render penguin-report.qmd -P species:Gentoo --output gentoo-report.html) also works as expected. As does your code
quarto::quarto_render("08-knitr/penguin-params.qmd").
However, things go off the rails when the output_file = argument is used in quarto_render, as in
quarto::quarto_render(
"08-knitr/penguin-params.qmd",
execute_params = list(species = "Gentoo"),
output_file = "Gentoo_report.html"
)
That code renders the Gentoo_report.html to the project root directory but puts the the supporting file directory in the 08-knitr directory. I have to manually copy the file to the intended directory to get the plot to show up. This is obviously non-functional when you scale up to something like the function you provide to walk through each species.
The function you provide in render-params.R in which you specify the directory in the output_file argument would be great, but it does not work for me. It generates the error
ERROR: --output option cannot specify a relative or absolute path
I have scoured the quarto-dev github issues and find this post, which makes me wonder how you got your function to work for you and all the workshop participants.
quarto-dev/quarto-cli#2329
If I take the subdirectory out of the output_file argument of render_fun(), it creates the requested outputs for each species, but they are in the project root directory and the supporting files are in the 08-knitr directory. I see in some of the github chatter that I can set one output directory at the level of the project, but that is not useful. How are you getting the files into the desired subdirectory?
Again, apologies if this is not the right place to post these questions. I have spent a full day trying to figure this out on my own.
One other unrelated thing about your penguin-params.qmd - The way you calculate the number of observations for each species is backwards - you are actually reporting the number of penguins that are NOT the species included in the report. Also the heading for the figure is better given as - The distribution of body mass for the
r params$species
penguins are shown below.rather than just - The distribution for ther params$species
penguins are shown below. I realize you were just showing examples of how to include such information but thought you would want the information to be accurate.The text was updated successfully, but these errors were encountered: