Sweave is a function in the statistical programming language R that enables integration of R code into LaTeX or LyX documents.

learn more… | top users | synonyms

2
votes
0answers
131 views

Sweave (using R Studio) with AEA class

Apologies for the newbie question! I've been having some problems trying to get a minimal working example using Sweave with a the AEA document class. My minimal example works as a .tex file, but the ...
0
votes
1answer
543 views

Special characters in knitr generated figure caption

I would like to pass special characters and formatting with the knitr generated captions. I am trying to understand two things: 1) Is it possible to pass LaTeX syntax through the caption? 2) How ...
5
votes
1answer
60 views

How can I figure out which parameters are passed to xelatex by Rstudio?

I'm using Rstudio to create a nice pdf report using sweave and xelatex. I can process the sweave file in Rstudio, but I'm trying to wrap this into a script, so I need to figure out what parameters are ...
0
votes
0answers
28 views

How to prevent plots being printed out of document's sections? [duplicate]

I am preparing a document using knitr in which I have multiple charts within two or more sections. The majority of the plots is printed at the end of the document but I would like them to stay within ...
5
votes
1answer
455 views

Selectively suppress caption numbering when using xtable

I have a chunk of code which is producing table output using Xtable and I would like to suppress the table numbering. I know I can suppress numbering using \caption* outside of Xtable but I'm stumped ...
8
votes
2answers
250 views

What tools are there to make LaTeX more viable at work

I do data mining in R, Python and various object oriented languages. I like using LaTeX to present my results; either to myself (i.e. use them for result interpretation/analysis) or to send to ...
0
votes
2answers
731 views

Fit to landscape longtable generated with xtable and sweave

I read many TEX questions/answers on fitting a table to your page width, but cannot figure out how to do apply it in my context (using xtable/sweave). Everything that I tried (using adjustbox, tabu) ...
2
votes
1answer
590 views

How to debug if Knitr quits unexpectedly when composing tikz figure

I have a .Rnw file that Knitr used to compile perfectly fine until my backend dataset changed. Probably then the size of the graph changed also. For reasons I don't understand knitr now stops abruptly ...
3
votes
1answer
1k views

Sweave on Windows 7 - using Texmaker

So I've tried to configue Sweave on Texmaker following these instructions: http://arts.uwaterloo.ca/~tmparker/722/hw/Setup_Sweave_in_Texmaker.pdf When I go to run this example: ...
2
votes
1answer
203 views

knitr compiling time with large datasets

I noticed that with a large dataset knitr takes an unexpected long time to compile my document: about 23 minutes from when knitr completes the last chunk to when it writes the .tex. I don't understand ...
1
vote
0answers
88 views

Jump from PDF line into .Rnw (with Skim)

I have a LaTeX document saved as .Rnw which I compile with Sweave to get a .tex document and finally-once compiled with LaTeX, a PDF. Now with Skim I can jump from a line in the PDF back into the ...
2
votes
1answer
924 views

Plots are not appearing in PDF after using Sweave

In general, Sweave is making great looking PDFs for me. However, when I plot a histogram, it is not appearing in my PDF. I have a bare bones Sweave document as follows. I can't seem to isolate ...
2
votes
2answers
1k views

KILE Sweave Error - “Cannot open log file; did you run LaTeX?”

I am using Sweave to generate a pdf from a .Rnw file. I added a new build configuration in Kile using Kile's build-configuration settings. Settings > Tools > Build OS is Windows 7. How do I ...
2
votes
1answer
140 views

How to escape inline R command to avoid issue with “while-typing” spelling check

I have a problem with my text editor Aquamacs Emacs (GNU Emacs 23.4.1) when use it with \Sexpr to print inline the output from R functions. The problem results when the R command includes special ...
8
votes
1answer
1k views

How to build Knitr document from the command line

I would like to compile a knitr document from the command line. With Sweave, the sequence R CMD Sweave my_sweave_file.Rnw latex my_sweave_file.tex latex my_sweave_file.tex dvips my_sweave_file.dvi ...
0
votes
1answer
107 views

Insert Sweave into LaTeX

I have already done most of my final paper using normal LaTeX and inserted a table using pgfsplotstable. However, I find it particularly difficult to edit/ style the table using this packages syntax. ...
4
votes
1answer
206 views

Repeating section with identical structure and different content

I would like to repeat identical subsection format with different contents. For example \documentclass{article} \usepackage{graphicx} \begin{document} \section{Intro} \subsection{A-text} ...
1
vote
1answer
410 views

LaTeX Suite Autocompletion Feature Not working With Rnw file

I have been a great fan of Vim with its awesome Vim-latex suite providing extremely useful keybindings and autocompletion features. Then I installed vim-r-plugin and opened a .Rnw Sweave file. While ...
2
votes
1answer
428 views

How to add horizontal lines within a table created by Hmisc::latex()?

lets suppose we have a table given in R and use the function latex() from the R package Hmisc to include the table in a Sweave (or knitr) document. My question is: Is there a way to add horizontal ...
10
votes
2answers
1k views

Building TeX file from knitr Rnw as child of larger parent TeX file to use R objects and output

Here's my general problem: I'm writing my dissertation using a LaTeX template (http://www.latextemplates.com/template/masters-doctoral-thesis). The template is a parent file with multiple chapters as ...
2
votes
1answer
149 views

How can one make RStudio pass options to Sweave()?

I'm trying to use a UTF-8 encoded .Rnw file in combination with xelatex in RStudio. Since xelatex uses native UTF-8 support i cannot use \usepackage[utf8]{inputenc} in my .Rnw file, which would ...
3
votes
1answer
329 views

How can I center a Sweave verbatim chunk?

I have a very simple sweave chunk with two lines, like this: <<results=verbatim>>== quantile(foo$bar) @ How can I center this element? I've tried embracing the chunk with \begin{center} ...
1
vote
0answers
2k views

Fatal error occurred, no output PDF file produced in php file [closed]

We are using following code in .php script for generate .pdf file. $result1 = exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw"); $result2 = exec("pdflatex /var/www/html/r/r_latex_sweave.tex"); ...
0
votes
0answers
2k views

Fatal error occurred, no output PDF file produced [duplicate]

we are executing following code from .php file. $result1 = shell_exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw"); $result2 = shell_exec("pdflatex /var/www/html/r/r_latex_sweave.tex"); But, ...
1
vote
1answer
289 views

Sweave function in r fails with Error (option: results seems causing the issue)

I got the below function from Prof's website: http://diskworld.wharton.upenn.edu/~foster/teaching/471/sweave-intro.pdf The said function is meant for converting sweave (.Rnw) into PDF. But when i ...
3
votes
1answer
825 views

How can I insert Sweave code inside a Beamer block?

I'm currently trying to automate a report-generating routine in R, and I imagine the best way to try this is through Sweave and beamerposter. The report should have one page with several sections in ...
3
votes
1answer
4k views

Reinstalling LaTeX in Ubuntu 13.04 [duplicate]

The LaTeX in my system cannot support Sweave compilation to pdflatex, it warns for missing .sty files. I want to clean my system and reinstall a more complete LaTeX. What is the better way for doing ...
3
votes
1answer
296 views

Is there a PythonTex equivalent to \Sexpr{} in R?

I started to use the excellent PythonTex package to write reproducible reports but can't seem to get it to evaluate Python code inside a LaTeX command. R has Sweave & knitr which provide the ...
2
votes
1answer
127 views

Sweave.sty causing error in verbatim environment?

folks-- The following throws an error, shown below \documentclass{book} \usepackage{Sweave} \begin{document} \begin{verbatim} data ds; infile 'dir_location\filename.csv" ...
3
votes
1answer
313 views

Sweave outputs gibberish

I have this .Rnw file: \documentclass{article} \begin{document} <<>>= data(cars) fit <- lm(cars$speed~cars$dist) summary(fit) @ \end{document} I am using RStudio to build the PDF ...
2
votes
2answers
2k views

Installing Sweave for Miktex 2.9 on Windows 7

I've been looking everywhere, but my computer (Windows 7) just won't install the Sweave.sty package for Miktex 2.9. I tried to put it in a folder respecting the TDS standard, and then to install it, ...
2
votes
1answer
681 views

insert figure in sweave using knitr fig.path

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 ...
1
vote
1answer
183 views

How to print a system of linear equations in matrix form using sweave?

I would like to print a system of linear equations, a right bracket, a right arrow and finally the output of the system (x). Something like Ax = b } ---> x. It is hard for me to find the right way of ...
1
vote
0answers
44 views

Citations not working in Sweave [duplicate]

I am trying to run this Sweave code in R. \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} \section{Section} I am citing \cite{ftest}. \begin{thebibliography}{9} ...
2
votes
1answer
554 views

\Sexpr shows only one value from a vector with two elements in sweave

I can't get the two elements of the vector using: <<>>= z=c(1,2) @ \Sexpr{z} I have googled a lot but don't understand why I get just the first element.
3
votes
1answer
173 views

Why could \usepackage{Sweave} be affecting my graphics scaling?

I'm using Sweave to produce a large, multi part academic thesis. I had neglected to specify \usepackage{Sweave} in my preamble, but everything was working fine until I added some verbatim output from ...
2
votes
1answer
237 views

Doodle on top of Sweave output

It might not be possible to do this, but I was wondering if there is a way to doodle on top of the LaTeX output, or in my case on top of Sweave output. See example underneath!! ...
1
vote
0answers
73 views

Figure positioning in Sweave [duplicate]

I starting learning Sweave today, and I am having difficulty positioning my figures correctly. I am finding that when I use the figure environment, the position of the figure doesn't correspond to its ...
0
votes
1answer
113 views

Count the characters in a section and check against range

I want to count the number of characters within a section and then display if that value is below, in, or above the limit. I have grabbed the code from Dynamically count and return number of words in ...
2
votes
1answer
195 views

PDFLaTeX produces black boxes after executing Sweave

There is the following code \documentclass[a4paper]{article} \begin{document} hey there <<>>= 1+1 @ \end{document} I saved the example.Rnw in my home directory an ...
0
votes
2answers
651 views

Sweave: run a bat file in Windows 7

When I run a RNW file inside RStudio compilation is working. But when I try to run the same RNW file through a BAT file, compilation is not working. I am a Win 7 user, using MixTex... Actually my ...
5
votes
1answer
195 views

How to check image exists or not?

I'm working on Sweave and using includegraphics for include image in report dynamically. Pseudocode: <<> for ( i to 100) # run loop 1 to 100 { ...
0
votes
2answers
275 views

How to remove name while including image in LaTeX?

I am including an image in R and found the name of the image file appearing with the image: name<-c("A.pdf","B.pdf","C.pdf","D.pdf") <<echo=FALSE,results=tex>>= for (i in 1:4) ...
1
vote
2answers
379 views

Sweave documents: saving output for later use

I am fairly new to the idea of sweave documents. My document is a .Rnw file containing LaTeX code and R code. Part of my R code is computationally intensive and delays the compilation of my .Rnw ...
6
votes
1answer
303 views

Using Sweave and XeLaTeX

I'm doing a report that is heavy in R but also would like to use system fonts, so I was hoping to be able to use Sweave and XeLaTeX. My preferred tex editor is TexShop (Mac 10.7), but it seems to ...
6
votes
1answer
202 views

Why are \twoheadleftarrow and \leftarrow so different? [Sweave, listings]

I am wondering why the \twoheadleftarrow in the code below looks so much different from (worse than) the \leftarrow, although according to the LaTeX symbol list, the arrow heads should be of the same ...
2
votes
2answers
570 views

minted: How to pass LaTeX commands via \newminted and how to use different styles?

I would like to use minted to redefine the Sweave environments Sinput and Soutput (see the example below). This way, I can have minted format my R code. There are two problems left: 1) Is it possible ...
1
vote
1answer
190 views

Sweave: How to remove horizontal space in Soutput environments?

As the following example shows, there is a horizontal space added in the Soutput environment. This leads to a non-left-aligned output (see the output of rnorm(). I found that this space already exists ...
5
votes
1answer
620 views

How to randomize content with examdesign package using Sweave

Forgive me in advance if this is a dumb question, or too specific to one package. I've been using examdesign to randomize the order of questions, but I also want to randomly generate the content. I've ...
6
votes
1answer
920 views

Passing a variable from TeX to R in Sweave

I know it is possible to use \Sexpr to pass information from an R chunk to LaTeX. For example, <<echo=F,results=hide>>= a = 7 @ 42 is the answer to 6 x \Sexpr{a} Is there an ...