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
821 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 ...
4
votes
1answer
244 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 ...
2
votes
1answer
54 views

Column Vector Sweave \Sexpr

I'm having big problems trying to compile a file using Sweave displaying a vector defined in an R chunk, as a column vector in Latex using pmatrix, I have something like this: ...
1
vote
1answer
88 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 ...
4
votes
0answers
147 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 ...
2
votes
0answers
68 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. ...
2
votes
0answers
116 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 ...
1
vote
0answers
37 views

How to export changes from a .tex file back to the source .Rnw file

Let's say my work-flow is writing a paper with multiple R chunks as a .Rnw then compiling it into a .tex file and then typesetting it into the final document. Now, after the document has been ...
1
vote
0answers
124 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. ...
1
vote
0answers
101 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 ...
1
vote
0answers
76 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 ...
0
votes
0answers
36 views

Convert .R into Latex

I'm really new at this and I couldn't found any realted subject. So I've created my .R file where I generate my graphs from my data: barplot(wmaefile$FC,xaxt="n",col="snow2",border="black", ...
0
votes
0answers
27 views

Control stargazer table output in combination with mathpazo and siunitx

I like the idea to control all my numeric outputs with the smallest number possible of packages. I use mathpazo to control my fonts and siunitx to control formatting. Yet when I knit a LaTeX table ...
0
votes
0answers
19 views

Why does \usepackage{Sweave} change table width?

Recently is has been indicated (Why could \usepackage{Sweave} be affecting my graphics scaling?) that adding \usepackage{Sweave} to your preamble might change the width of your graphics. Peter solved ...
0
votes
0answers
36 views

Error R Sweave and Knitr Plugins at WinEdt 8.0?

I try a simple example document .rnw at WinEdt with R Sweave Plugin like this : \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} \textbf{hello world} ...
0
votes
0answers
18 views

How to use texmaker with Sweave?

I've tried to use Sweave with texmaker but it doesn't work. I go to the menu "R Sweave", I push the button "->" and texmaker creates a wrong latex file with a lot of "NA". When I try to do pdflatex ...
0
votes
0answers
45 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 ...
0
votes
0answers
59 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 ...
0
votes
0answers
52 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
100 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)) ...