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
548 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 ...
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 ...
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} ...
4
votes
0answers
97 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 ...
4
votes
0answers
120 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 ...
3
votes
0answers
20 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 ...
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. ...
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 ...
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. ...
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 ...
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 ...
0
votes
0answers
7 views

Xtable and Sweave

My question is regarding xtable and sweave. I have a certain table created in RStudio and want to create a pdf file using it. I use the package Sweave and write the necessary code and I get the ...
0
votes
0answers
25 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 ...
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 ...
0
votes
0answers
31 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
46 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)) ...
0
votes
0answers
83 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 ...