General ⇒ R and Latex
R and Latex
thanks.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Re: R and Latex
you should consider to show us a small example of your .Rnw file in order to be able to help you. I have used the Sweave->Latex route many times and, when I did not make mistakes, never had problems.
So, where does you problem occur:
1: in R, by running the Sweave function
2: when compiling the .tex file to a dvi or pdf
Regards,
Albart
Re: R and Latex
I dont Know what is the so called .Rnw,.sty, etc files and how to create them.
I tried the following example from some where,I copied it and ran it on Miktex:
\documentclass[a4paper]{article}
\begin{document}
<<>>=
data(airquality)
library(ctest)
kruskal.test(Ozone ~ Month, data = airquality)
@
\begin{center}
<<fig=TRUE,echo=FALSE>>=
boxplot(Ozone ~ Month, data = airquality)
@
\end{center}
\end{document}
I dont get the PDF with the R codes.
R and Latex
then it is good to learn about these files. You should place the code in a file: file.Rnw and the run the Sweave function in R on this file:
Code: Select all
Sweave('file.Rnw')
I would encourage you to read the documentation of Sweave at http://www.stat.auckland.ac.nz/~stat782 ... manual.pdf.
Albart
Re: R and Latex
When I sweave in R,
> Sweave("myfile.Rnw")
I get the following error;
Writing to file myfile.tex
Processing code chunks ...
Error in SweaveReadFile(file, syntax) :
no Sweave file with name 'myfile.Rnw' found
What could be the correct saving because that is what I think is the mistake that I cannot locate the file "myfile.Rnw" or what should I do?
Thank you
Karisa,l.k.
Re: R and Latex
Karisa,l.k.