admin管理员组文章数量:1390410
I'm working on a Quarto project in VS code with a .qmd file ("01_data_exploration.qmd") that includes a ggplot2 plot. The plot displays correctly in an interactive R session, but when I render the .qmd to HTML, I get a 404 error referencing a missing figure file:
Watching files for changes
Browse at http://localhost:5335/
Rendering HTML preview [index.qmd]
GET: /
GET: /notebooks/01_data_exploration-preview.html
/notebooks/01_data_exploration_files/figure-html/germ-1.png (404: Not Found)
My R codeblock within my .qmd file looks like this:
# Create plot
p <- ggplot(mean_per_regiontype_DE, aes(x = month, y = mean_active_per_100k, color = lage_typ)) +
geom_line() +
geom_point() +
scale_x_date(date_breaks = "1 month", date_labels = "%b %Y") +
labs(title = "Germany: Mean active per 100k pro Regionstyp",
x = "Month",
y = "Mean active per 100k",
color = "Region type") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 90, hjust = 1))
# Explicitly print the plot
print(p)
The figure actually seems to be saved in a different folder than Quarto expects. How can I make sure Quarto places the figure in the correct location so it shows up in my final HTML document?
Any help or suggestions are much appreciated!
knitr::opts_chunk$set(echo = TRUE)
didnt help:(
本文标签: knitrWhy does my Quarto document produce a 404 error for R plots when I renderStack Overflow
版权声明:本文标题:knitr - Why does my Quarto document produce a 404 error for R plots when I render? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744723086a2621810.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论