Tagged Questions

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

5
votes
1answer
2k views

Difference between \Sexpr and <<>>=

I am new to sweave and learning a lot. For the most part \Sexpr works well for simple variables and also calling R functions. But other times it will fail, I have found that I can get around this ...
3
votes
2answers
626 views

Reduce space between Sinput and Soutput

I'm using Sweave in the book document class, and I'm getting really huge spacing between Sinput and Soutput evironments. \documentclass[11pt]{book} \usepackage{Sweave} \usepackage{boxedminipage} ...
5
votes
2answers
1k views

How to prevent text generated with `Sweave` from running off the right margin?

I am using Sweave to generate output for some R analysis. Some of the code generates long lines that are run off the right margin when the .tex file is compiled. I have pasted an example Schunk ...
3
votes
2answers
934 views

How to redirect SAS output to LaTeX?

I'm wondering how can the SAS output directly be redirect to LaTeX as we can do by using Sweave with R. Thanks
6
votes
1answer
2k views

Sweave, Beamer and ggplot2

There's literally nothing on the internet showing how these work in conjunction with one another. I would really appreciate even the simplest example of a Rnw document that you would run with Sweave() ...
3
votes
1answer
2k views

What's the best tutorial for beamer, sweave and ggplot2 combined?

I'm looking for the best example presentation publicly available on the Internet that uses beamer, sweave and ggplot2 all at the same time. Ideally it would be the actual example .Rnw file, along with ...
1
vote
2answers
2k views

Resize Arrays and Figures in a Sweave document.

How is it possible to resize figures produced via a Sweave script? I tried scalebox and others, but I can't succeed to obtain a figure with an acceptable size in my beamer with direct Sweave output ...
5
votes
1answer
2k views

FancyVerb error for Sweave output in Beamer

I'm having trouble including Sweave output in my Beamer file. Specifically, the Soutput environment is causing problems (it runs if I comment those lines out, but, of course, the table is not ...
1
vote
1answer
568 views

Using Sweave to include lattice graphics - issues with colour

I am using Sweave and the R package nlme: when including lattice graphics, (encapsulated in the print() command), the .eps files that are generated are all in black and white. The original graphic, ...
0
votes
1answer
477 views

What's wrong with this Sweave Document

Every time I run the code below, it runs without error. It is only when I try to sweave the output in the last frame requested does it fail. What's more confusing to a LaTeX/Sweaving newbie like ...
1
vote
1answer
651 views

Size of Sweave Output

I am very new to LaTeX and Sweave, and I am just playing around with getting some output. That said, the "output" I am getting is very large in size (physcially on the page). For example, one output ...
5
votes
1answer
634 views

Remove\begin{Schunk} \begin{Sinput}

I am using Sweave to produce my tex. In addition I use lstlisting to highlight the source code as below. \begin{lstlisting}[caption={Computation $\widehat Y_4$ and its ...
3
votes
2answers
771 views

Using the “master file” with emacs and Sweave

One of the things I love about emacs is being able to specify a master file, then compile an included .tex file - I just use C-c C-b For sweave documents, I have the following layout: master.Rnw ...
2
votes
1answer
604 views

vim on Rnw (sweave) files: how to indent <<>>== properly?

When I use vim-latexsuite to indent my .Rnw files, the Sweave blocks get indented, which causes them not to work properly. What I need is a way to ensure that the vim indent scheme puts these blocks ...
2
votes
1answer
941 views

I cannot use Sweave to process a file created in TeXmaker (or Gedit) under Ubuntu 10.10

I am attempting to use Sweave with R2.11.1 and Texmaker on Ubuntu 10.10. I have done this previously on Windows XP, where one saves the tex file as .Rnw and then processes it with Sweave. I have all ...
4
votes
2answers
2k views

Integrate 'Sweave.sty' in the TeXLive 2010 search path (on Linux)

I'd like to add 'Sweave.sty' to my search-path, so that I don't need to copy 'Sweave.sty' to every Sweave-Document I create. I've located 'Sweave.sty' in '/usr/share/R/share/texmf/tex/latex'. I tried ...
3
votes
2answers
1k views

Supplying string parameters to Sweave document

This must be a simple question but I don't figure out how I can do it. I would like to produce a pdf report using Sweave. And actually, many many reports. I shortened and simplified the sweave code ...
8
votes
5answers
2k views

How to get correct dimensions for a ggplot2 plot in beamer

I have a beamer presentation made with Sweave that I'm preparing and was wanting to place some ggplot2 graphs in but the aspect ratio does not seem to come out correct. This is what is in my Rnw ...
9
votes
1answer
1k views

how to colorize syntax using R + Sweave?

I'm writing a LaTeX document using Sweave (a Beamer presentation, really), which weaves R code and LaTeX. Is there a way to make my chunks of code and its output highlighted? I could use listings ...
12
votes
4answers
680 views

Workflow in Sweave: Handling TeX errors

I've been using LaTeX and R for a few years now, but am only now bringing them together via Sweave. As I put the document together, I run my R code in its own session to verify that it works properly, ...
3
votes
1answer
1k views

Using Sweave, how can I reliably get .PNG figures instead of .EPS or .PDF figures?

I have tried to set the options in the preamble: \SweaveOpts{keep.source=TRUE, eps=FALSE, pdf=FALSE, png=TRUE}, but this does not reliably produce only .PNG (or indeed any!) figures. I say 'reliably' ...
6
votes
4answers
3k views

Multiple Tables Sweave/Latex

I am very new to LaTeX and Sweave but am excited that it may make my life much simpler when combined with R. What I am looking to do: Create multiple crosstabs, most likely in a loop. As a result, ...