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

1
vote
2answers
30 views

First row in second table created is blacked out

I am a LATEX/R/Sweave newbie and am encountering an issue while creating a report. The issue is that as shown in the figure below the first heading in the second table is blacked out. I am able to ...
3
votes
0answers
19 views

inline knitr code that isn't a simple number

It is easy enough to do something like \Sexpr{1 + 1}. But how can I do \Sexpr{mymatrix} with mymatrix being a matrix object in R workspace? More generally, how can I print object that is more complex ...
0
votes
0answers
24 views

Can I produce a .tex file from .Rnw?

Before I sink all of my work into .Rnw format, I hope to know whether it is possible to produce .tex files? I know that I can knit .Rtex file to produce .tex, however Rstudio does not support .Rtex ...
4
votes
1answer
32 views

Turning off line-wrapping in auctex for smooth transition with ess in same file

I sometimes use auctex + ess for Sweave/knitr documents. Every time I switch from auctex to ess and vice versa, there is a pause/jolt while the auctex lines re-wrap themselves. Previously, I also ...
0
votes
0answers
38 views

Sweave pdf is failing

fig=TRUE month.=season(x03) x03.lm=lm(x03~month.+time(x03)) summary(x03.lm) @ This part of my file is failing and I am not sure why. I have attached library(TSA) for the season part, but it ...
2
votes
1answer
87 views

Controlling formatting options for xtable

All, I'm a LaTex/knitr/Sweave amateur and have had trouble finding answers to what seem like they should be fairly simple questions online. I have a .Rnw script that I am currently compiling to PDF ...
1
vote
1answer
40 views

Sweave boxplots — not the required output

I want to produce a boxplot like this in R: fishdata <- read.csv("http://dl.dropbox.com/s/4w0utkqdhqribl4/fishdata.csv", header=T) attach(fishdata) boxplot(fishdata[,-1], las=3) which looks like ...
5
votes
2answers
88 views

What do Sweave/knitr offer that make doesn't?

I use LaTeX to write papers and R for data analysis and visualization, so I've been looking into Sweave and knitr. The Sweave website says: The purpose is to create dynamic reports, which can be ...
0
votes
0answers
30 views

Make .Rnw child document independent from main document

This is a followed-up question to this answer. I have a variables.Rnw document in charge with the task of loading data from R datafiles and create R variables that I will then compile into a .tex ...
5
votes
0answers
55 views

noalign and \include

I have reduced my code to the following lines: \documentclass[9pt,letterpaper,oneside]{amsart} \usepackage{graphicx} \usepackage[table, dvipsnames]{xcolor} \usepackage{longtable} ...
1
vote
1answer
46 views

How to create a newcommand with knitr?

I am using knitr and I'd like to make some new commands to combine common tasks into one, e.g. \newcommand{\numps}[1]{\numprint{\Sexpr{#1}}} so that I can do something like \numps{pi}. I can't seem to ...
0
votes
0answers
44 views

Is it possible to place a chunk within a chunk?

I am asking this question because I need to loop a \section tile by a chunk and place the according result in the section using another chunk. Here is an example of one circle: The chunk for ...
0
votes
0answers
48 views

xtable for multiple lm regression in R?

I'd use xtable for an object from a multiple lm regression but always failed. Here is an example: df<-data.frame(y1=rnorm(100,2,3), y2=rnorm(100,3,2), x1=rbinom(100,1,0.5), x2=rnorm(100,100,10)) ...
4
votes
0answers
96 views

RStudio, Sweave and synctex

For a few days now I was wondering why RStudio stopped showing the "Sync PDF view to editor location". I still don't know for sure, but since my .synctex.gz file is apparently "(busy)" I assume there ...
3
votes
1answer
728 views

Latex Error: 'Sweave.sty' not found?

I downloaded the most recent version of Miktex Basic Installer (2.9.5105). After following the Miktex's instructions, I began working through Nicola Satori's Sweave Tutorial. The R portion of ...
4
votes
0answers
119 views

Color first row in a xtable generated table

I am trying to color the FIRST row of my table. But if I add \rowcolor[gray]{0.95} to the FIRST row the colored row will be the SECOND. Indeed it is quite straight forward to modify from the second ...
1
vote
0answers
96 views

Define style of xtable

I want to set the style of tables built with xtable by looping on multiple dataframe. I then look for some macro so to set the style in the preamble and not directly within the tabular environment. ...
2
votes
1answer
93 views

How to loop over R objects OUT OF chunks

I want to typeset with TeX a report based on data from an R object (dataframe). The idea is to print a nice TeX table from each line of a R dataframe. Something like \begin{tabular}{ l c r } A1 ...
1
vote
0answers
72 views

How to keep title, table and caption together in 1 page?

I have one table which is dynamic (number of rows varies from 2 to 20). This table has title and caption. But I need title, table and caption all 3 should be in the same page i.e. need to avoid title ...
6
votes
1answer
157 views

Is it possible to get Sweave/knitr in RStudio to output the .tex file without typesetting it?

I would like to know if it is possible to tell Sweave or knitr in RStudio to create the .tex file without trying to typeset it. I want to be able to run my .Rnw file and produce a .tex file which I ...
4
votes
1answer
314 views

longtable misplaced noalign

Question Why am I getting multiple misplaced \noalign errors? Reproducible example \documentclass{scrartcl} \usepackage{longtable} \usepackage{booktabs} \begin{document} \section{Table test} ...
2
votes
0answers
52 views

Can a TeXShop engine set the #PDFPATH#?

I have written an engine to run Sweave (a preprocessor) from TeXShop. It works fine on simple projects. For complicated projects (e.g. books), I might want to run the preprocessor on a chapter (e.g. ...
3
votes
1answer
62 views

Making comments stand out when using Sweave and R

Is there any way to bold or highlight all comments when using Sweave? Maybe a command to make all lines starting with # be bolded? <<>>= # I want this to be bold automatically @
2
votes
0answers
97 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
141 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
38 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
212 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
212 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
1answer
242 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) ...
1
vote
1answer
244 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
558 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
98 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
63 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
255 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 ...
1
vote
2answers
542 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
91 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 ...
5
votes
1answer
449 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
90 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
140 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
293 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
226 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 ...
6
votes
1answer
494 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
98 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
174 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
676 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
953 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
205 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
345 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 ...