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
0answers
20 views

knitr render html code

How to render html output to pdf in knitr? Here is my code \documentclass{article} \begin{document} <<echo=TRUE, results= 'asis'>>= library(xtable) n <- data.frame(x = 1:6, y = 15:20) ...
0
votes
0answers
37 views

Compiling .Rnw file into PDF in RStudio (Error: No file or directory)

I have a .Rnw file. I usually can "Compile" it into a PDF file in RStudio. However, I recently upgraded my R Version to 3.2.0. Now, when I try to "Compile" my .Rnw file I get an error: ...
1
vote
0answers
58 views

Table dull when transferred from R to word [closed]

I am using latex in R (mostly copied codes) to make beautiful tables. But transferring tables with the help of snipping tool used or saved as jpg from R to word, the table looks dull and not rich ...
0
votes
0answers
35 views

Latex in R getting error after putting code

I am getting this error in R ...after putting code for latex document Undefined control sequence Overfull\hbox(7.71355pt too wide) in paragraph at lines 16--16 Code is below ...
0
votes
0answers
32 views

Sweave's “fig=TRUE” cannot write file

I use Sweave to get my R data into LaTeX. While this works fine with "just data", I am not able to include plots. My .Rnw-file looks like this: \documentclass[a4paper,10pt]{article} ...
2
votes
0answers
32 views

After updating to LyX 2.13: getting this message Sweave Noweb syntax? [closed]

After updating to LyX 2.1.3, I'm getting this message Sweave Noweb syntax?. I wonder what message mean and why I'm getting it? After clicking on ok, it works but I'm looking to not show this ...
3
votes
1answer
231 views

pdflatex cannot find PDF

I am using Sweave (in Emacs) to generate a report. I can compile the .tex file just fine. There are images (PDFs) that I generate (I have graphicx included in my \usepackage{}; I am not dealing with ...
1
vote
1answer
45 views

Cropping an image generated in R code

I would like to crop an image that is not inserted (which has been searched a lot), but an image that is generated in R code. \documentclass{article} \setlength{\parindent}{0pt} ...
3
votes
1answer
99 views

Table too large for longtable?

i have a very wide table that will not fit on a page horizontally (nrow = 127, ncol = 60). I am using longtable to handle the number of rows (breaking onto the next page when the number of rows are ...
1
vote
0answers
49 views

Blog publishing / creation from Latex

I have been using Latex for a few years, and have several articles written in Latex. I want to share some of these articles on blogs, and I am very new to the blogging world. Just wondering if there ...
1
vote
0answers
40 views

Using xtable with listings package

I am the listings package as suggested by the following solution provided in this question: Getting Sweave code chunks to stay inside page margins? More specifically, I am using the following piece ...
2
votes
3answers
118 views

What's the best .Rnw editor?

I'm trying to find out what people use for editing .Rnw files. Desirable features are: Auto R code completion Auto LaTeX code completion Cross platform Automatic display of R function documentation ...
2
votes
1answer
198 views

knitr: LaTex Longtable spanning several pages with word continued at bottom and caption appears only once in list of tables

I want to have longtable spanning several pages with word continued at right bottom of the table and its caption appearing only one in the list of tables using knitr. Below is my MWE in .Rnw format. ...
2
votes
1answer
126 views

insert figure in sweave using knitr fig.path Version 2

I have a question similar to this post. I am trying to add a .jpg to a .Rnw file (compiling LaTex with RSweave and knitr). I've tried the following without success: ...
2
votes
1answer
219 views

RStudio problem with xtable “results=tex”… “object tex not found”

I am using the 'compile pdf' button in a .Rnw file in Rstudio, including the following: <<longterm1, results=tex, echo=FALSE>>= print(xtable(longterm), include.rownames=FALSE, ...
0
votes
0answers
44 views

Sweave in TexShop

I am trying to configure Sweave directly from Texshop, currently I am using versions 3.44 and 3.11 (Maverick build) for Textshop and R respectively. I have followed the instructions given on the ...
1
vote
0answers
44 views

How to use pgfplotstabletypeset in combination with sweave

I am trying to make a table in LateX in which the background colour of my cells depend on the size of a number. I found some answers on Parametrize shading in table through TikZ but I cannot get them ...
3
votes
1answer
357 views

Sweave and Knitr Figure Size

I recently made the switch from using Sweave to Knitr in order to gain Knitr's ability to cache R code chunks. So far its been fairly straightforward except for one thing. I cannot seem to find an ...
2
votes
1answer
181 views

row and column specifications in xtable output

Using xtable I am trying to format a table x<- 1:5 y<- 11:15 mytable <- table(x,y) print(xtable(mytable)) Which gives I want to add x and y tag also at the top of the rows and sides
0
votes
0answers
57 views

Problem with Latex and Sweave

I want to use Sweave package of R to integrate my R scripts directly in Latex documents. I'm using v3.1.1 of R, where Sweave.sty is directly integrated (in R-3.1.1/share/texmf/tex/latex). I'm using ...
2
votes
1answer
70 views

Sweave — Must Always Recompile Every R Script?

I am writing a large document using a Latex, WinEdt, RStudio and Sweave. I have a large number of graphs that use SWeave code blocks (>30). Many of these blocks read in large data files from disk. ...
3
votes
1answer
85 views

Probsoln & Sweave

I just started learning the probsoln package so I can create problem sets. I have a basic example that is working: \documentclass{article} \usepackage{probsoln} \showanswers \begin{document} ...
1
vote
1answer
72 views

Tabs Affecting Compilation of SWeave Code

The following SWeave code, compiled using WinEdt 8.1 with the Sweave plugin produces a nice R image: \begin{figure} <<fig=TRUE, echo=FALSE>>= set.seed(123) x <- 1:10 y <- rnorm(10) ...
1
vote
1answer
54 views

Justifying the output of toLatex function of utils R package

Using utils::toLatex(sessionInfo()) in .Rnw we can get R Session Info to put in LaTeX. I would highly appreciate if someone guide me to fully justify the output of utils::toLatex(sessionInfo()). ...
0
votes
1answer
151 views

Sweave and R 3.1.0: no pdfs generated

After upgrading R to version 3.1.0 (from some version 2.x.x), the following sweave code does not produce any pdfs for the plots anymore: \documentclass[a4paper,10pt]{article} \SweaveOpts{echo=FALSE} ...
0
votes
0answers
117 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", ...
3
votes
1answer
256 views

R Chunk Code within Enumeration Environment with knitr in LyX

I need R Chunk Code within Enumeration Environment in Rnw file. The following .Rnw document works fine. \documentclass{article} \begin{document} \begin{enumerate} \item The quick brown fox jumps ...
1
vote
0answers
203 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 ...
3
votes
1answer
170 views

Memory issue when producing dense TikZ figure (14500 points scatterplot) with knitr

I have a series of plots in my document which are correctly drawn by knitr with dev=tikz. Yet figure number 7, which is much more dense than the others in terms of data points, foo, doesn't: label: ...
1
vote
0answers
134 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} ...
1
vote
1answer
292 views

How to render LaTeX (math) in Sweave (R) code comments

background A asked this question on SO yesterday because it seemed to be more programming-oriented, but there weren't any responses. Perhaps someone here might have an idea? I am writing a Sweave ...
2
votes
1answer
173 views

Color the column of a latex table produced by xtable

How can I use the R xtable package to produce a table with a colored column? This post shows how to color a row, but I can't figure out how to do the same for columns.
3
votes
2answers
528 views

how do you put caption on figures in sweave

I have this sweave code. I need to add caption to the figures. I am doing this but it looks like I see the figure before the section{Data ANALYSIS}: \documentclass[letter,12pt]{article} ...
3
votes
2answers
113 views

Typeset R character vectors

I have two vectors in R that I want to typeset. The first vector includes the titles and the second the body texts. Please consider the following MWE \documentclass{article} \begin{document} ...
1
vote
0answers
67 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
2answers
34 views

Scan () and Sweave Help [closed]

I used x=scan() for my data set and I do not know what the proper code is to put it in my sweave file. I have tried looking on the internet for help, but I could not find anything. I did try ...
2
votes
1answer
120 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: ...
0
votes
1answer
494 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 ...
2
votes
2answers
166 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 ...
4
votes
1answer
351 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 ...
4
votes
1answer
77 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
51 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 ...
3
votes
1answer
3k 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
111 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 ...
8
votes
3answers
864 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
110 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 ...
6
votes
1answer
184 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} ...
2
votes
1answer
153 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
252 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
4k 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 ...