Reputation: 2443
I am trying to manually knit an rmd document which calls a figure fig1.gif
.
! Unable to load picture or PDF file 'fig1.gif'.
<to be read again>
}
l.91 \includegraphics{fig1.gif}
The way I call the figure is:

The figure DOES exist in the directory. Any idea what the problem might be?
Upvotes: 1
Views: 1477
Reputation: 11649
I don't have your code, but i can give you 2 hints:
relative path
of the file. I found a sample from this question.
imgAddress="./ADDRESS bla bla/fig1.gif"
if (!file.exists(imgAddress)) {
print("File is not found") }
}
I should cast doubt on the way which you load the image. There are several packages which ,may help you:
library(magick)
tiger <- image_read_svg('http://jeroen.github.io/images/tiger.svg', width = 400)
print(tiger)
OR
earth <- image_read("https://jeroen.github.io/images/earth.gif") %>%
image_scale("200x") %>%
image_quantize(128)
length(earth)
Please read the below link. it will be usefull.
https://cran.r-project.org/web/packages/magick/vignettes/intro.html
Upvotes: 2