Didplay ggplot2 graphs with knitr

My Rmd file has the code below in the header of the file. The include_graphics part produces an error:
pandoc.exe: Could not fetch C:/Users/giuse/OneDrive/Documents/DataScience/R%20SCRIPTS/STORM%20DATA
C:/Users/giuse/OneDrive/Documents/DataScience/R SCRIPTS/STORM DATA: openBinaryFile: permission denied (Permission denied)
Error: pandoc document conversion failed with error 67
Execution halted
Could you help with this please?

knitr::include_graphics("C:/Users/giuse/OneDrive/Documents/DataScience/R SCRIPTS/STORM DATA", auto_pdf = getOption("knitr.graphics.auto_pdf", FALSE),dpi = NULL)

To display the graphs in the HTML and pdf documents?

---
title: "PA1_template.Rmd"
author: "My Name"
date: "October 3, 2019"
output:
  pdf_document: default
  html_document:
    keep_md: yes
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

I found the solution here: https://github.com/rstudio/rmarkdown/issues/228
However, now I get a different one. ! LaTeX Error: File `' not found.

This is the solution

knitr::include_graphics("C:/Users/giuse/OneDrive/Documents/DataScience/R SCRIPTS/STORM DATA/file.png", auto_pdf = getOption("knitr.graphics.auto_pdf", FALSE),dpi = NULL)

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