2

I'm trying to insert a figure using Sweave which is located in the path C:\Users\eccehomo\Documents\mi\fig1.png. I'm using the package knitrwhich has a function called fig.pathbut I'm getting many errors for such a simple thing! Here's one of the things I have tried:

<<fig1,fig=TRUE>>=
library(knitr)
f='C:/Users/eccehomo/Documents/mi/fig1.png'
@

\includegraphics{f}
3

Use \includegraphics{\Sexpr{f}}. LaTeX does not know the variables in R.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.