1

I am trying to get TeXpad (latest OSX-version) to compile a document with some R code, but just ends up with errors. This is my first try

My document

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel} 
\begin{document}
    You can type R commands in your \LaTeX{} document and they will be properly run and the output printed in the document.
 <<>>=
 # Create a sequence of numbers X = 2:10  
 # Display basic statistical measures summary(X)   
 @ 
\end{document}

When compiled with xelatex (or pdflatex) and preprocessed R code, either with Knitr or Sweave, it ends up without the R code being recognised. Is this not possible with TeXpad?

  • People might not be familiar with texpad. Does compilation work from a terminal? That is first knitr or sweave of this file, the pdflatex on the output from knitr or sweave – daleif Dec 21 '16 at 9:59
1

A very simple solution to my problem: When I renamed the file with extension .Rnw it compiled like it should.

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.