include external figures using relative paths in rmarkdown

Viewed 1039

How do I include external figures using relative paths?

I start my rmd file with:

```{r setup,include=F}
knitr::opts_chunk$set(cache=F,echo=F)
knitr::opts_knit$set(root.dir = '/Users/dosc3612/odrive/CUDrive/real-time_interpolation',
child.path='/Users/dosc3612/odrive/CUDrive/real-time_interpolation')
```

and then include:

# Heading 1
some text referring to figure 1. ![Figure 1. a map from qgis](data/gis/fig1alt-location_map2.png)

my rmd file is in /Users/dosc3612/odrive/CUDrive/real-time_interpolation/reports/real-time so my understanding is it will look for figures out of that directory. But based on chunk options help I thought I could use child.path to set relative paths in the document but that does not appear to be the case.

"data/gis" is a subfolder in "/Users/dosc3612/odrive/CUDrive/real-time_interpolation"

thanks

1 Answers
Related