I'm working on R Project trying to knit a PDF in Rmarkdown that includes a svg file.
First I tried:

And I got this:
! LaTeX Error: Unknown graphics extension: .svg
Then I tried:
```{r figSvg,eval=TRUE,echo=FALSE,message=FALSE, error=FALSE, warning=FALSE,fig.height=10}
library(cowplot)
svg_figure<-cowplot::ggdraw()+cowplot::draw_image(folder/file.svg)
plot(svg_figure)
```
But I got a blank space in my pdf, and I had to install the 'magick' library for the image to be drawn.
And once installed, I get this error:
Error in methods::is(image,"magick-image"): object 'folder' not found
The folder does exist, and when I try adding the png file of the same visual scheme, I have no errors.
Does anyone know what might be happening or about a different method to include a svg file into a pdf in Rmarkdown?
Thanks.