Reading your entry I imagine that you are using this type of Rmd file:
---
title: "Untitled"
author: "My name"
date: "6/17/2020"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
## Picture
This section contains a picture:
![my_picture](./mypictures/mypic.PNG)
End of document
Is this the case or are you using a different output type?
When the PNG file is indeed in the indicated folder (you did of course check the spelling and capitalization of the name of the file in the folder) this should also work for you.
The above code works for me (Windows 10). What environment are you working in?
I think there is something incorrect with my RStudio all together. I have installed rmarkdown several times, but here's an example when I run a chunk of code in an rmarkdown file everything comes out an error. Do you have any idea why that might be? I have even uninstalled and reinstalled RStudio to fix this but nothing seems to be working. In addition I have sent my files to a friend who opens them and runs them with the same errors, but then copies and pastes the code into a new Rmd file on their computer and my exact code runs without any errors. It's gotten pretty frustrating.
In your edit window I see that the contents of the Edit window is not saved yet:
the title is still Untitled1*.
(if I remember well one is requested to save the file when the knit button is used)
So the question: did you do this and if not: what happens when you do this. ?
Yes, I have saved my .Rmd files and ran them with the same errors. Here is the code under a saved .Rmd file. I'm unsure if it has to do with my settings or what but everything under all of my .Rmd files comes back with errors even though the code is correct.
This is before I try to knit though. When I knit simply the header it works. Then again problems come into play when I add the image, even though the path is correct. In this screenshot you can see how the image is there in my files and the path is correct but when I run the code it gives me a weird error saying there's an unexpected character. This is before I attempt to knit it as well.
Are you able to include the whole Rmd file by copying it into a reply?
As a picture as you have done before but now all lines in one picture or as text.
You can use four backticks before and after the text to make it more readable.
I can reproduce your error.
I get the same when I select all lines in the Rmd file and enter Ctrl+Enter.
However you can not run an Rmd file; only some or all R chunks and not lines outside these chunks/
So I think that settles the Run issue (?)
Two suggestions for the pandoc error
what happens if you leave out the path? So only specify ![Image](10-all-cases-log.png)
what result do you get if you make a chunk with only print(getwd())
The path to my .png file is: "C:/Users/Laura/Documents/RStudio/dsc520/assignments/assignment04/10-all-cases-log.png"
I am unable to post new comments anymore today, but know that I did create an r chunk. The ```{r} portion just didn't show up when I printed it on here. That's how I ran it, and it changed. And I set the working directory to ("~/RStudio/dsc520/assignments/assignment04"), and tried to use the code
![Image](10-all-cases-log.png)
Then I knit it and it went through. Thank you so much for your patience with me!
Problems with paths are more easily avoided by working with RStudio projects.
For this case you could have made a project in
~/RStudio/dsc520/assignments/assignment04
If you then open the project the working directory is automatically set and all files are by default saved in that directory. Check it out: it is very convenient.