Questions tagged [sweave]

Sweave is a function in the statistical programming language R that enables integration of R code into LaTeX or LyX documents.

Filter by
Sorted by
Tagged with
2 votes
3 answers
230 views

How to create a horizontal space of a desired length when creating a Table

I am new to LaTeX. Started yesterday. I've been working with R and am doing so now but found that it is possible to produce very nice tables with LaTeX.I have been searching and found some code that I ...
augusti's user avatar
  • 127
2 votes
0 answers
2k views

what does "Error running C:/Users/user/AppData/Local/Programs/MIKTEX~1.9/miktex/bin/pdflatex.exe (exit code 1)" mean?

I am trying to run this code in Rsweave \documentclass[a4paper,12pt]{report} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \rhead{\...
sid satam's user avatar
1 vote
1 answer
326 views

Sweave breaking on escape characters? [closed]

I'm attempting to build out a pdf using texworks and sweave. I can get an output just fine except for a certain chunk of code and I can't tell why. Here's an example of it working: \documentclass[...
AI52487963's user avatar
5 votes
4 answers
20k views

includegraphics scale not working

Im trying to change the size of the picture with "scale" but is not working \documentclass{report} \usepackage{graphicx} \usepackage[left=1.5cm,top=1cm,right=1.5cm,bottom=1cm]{geometry} \begin{...
Micael Salomon's user avatar
1 vote
0 answers
286 views

Prevent .tex file from opening automatically when working on .Rnw in TeXStudio

I'm working with a Sweave (.Rnw) file in TeXStudio (2.11.0). I have set up custom build commands to knit the Sweave file to LaTeX, with the idea to work on the .Rnw file exclusively. My problem is ...
Maxim.K's user avatar
  • 326
1 vote
0 answers
228 views

Fontspec, Sweave and MacTeX 2016: Font shape undefined

When I compile the following MWE with xelatex, compilation goes fine but I get this warning message: Font shape T1/TimesNewRoman(0)/m/n undefined(Font) using T1/cmr/m/n instead. The problem appeared ...
Stefano's user avatar
  • 865
0 votes
2 answers
1k views

how to make a graphic bigger

I've made the following syntax: \begin{figure}[ht] \caption{xxx } \centering <<echo=FALSE,fig=TRUE >>= load("//d049nt01/estudios$/Indicadores de Liquidacion/Tablas de prueba/pago_agg.rda"...
AngeG's user avatar
  • 3
2 votes
0 answers
4k views

Sweave error running pdflatex.exe (exit code 1) [closed]

I'm new to sweave, and I keep getting errors. I'm trying to run the following file: \documentclass[a4paper]{article} \begin{document} \SweaveOpts{concordance=TRUE} Hello world! \end{document} ...
RootFAIL's user avatar
2 votes
1 answer
227 views

Knitr/Sweave Format Code Output w/ Leading Characters

Using knitr/sweave, I need to format the R code output that gets echoed, according to editorial journal requirements. For example, the following chunk <<example,echo=TRUE>>= library(plyr)...
Nicholas Hamilton's user avatar
3 votes
1 answer
289 views

No increment of a variable in a Sweave code chunk which is wrapped by a \whiledo loop

I already searched in different forums but until now I couldn’t find a solution. So I hope that you can help me… Like mentioned in the title there is no increment of my variable x in the code chunk ...
tueftla's user avatar
  • 175
1 vote
0 answers
169 views

RNW, different sections depending on the value of a variable. Possible? [closed]

I am new to RNW files, and I am not sure if the following is possible. Suppose that I have the following RNW file: \documentclass[12pt,a4paper]{article} \usepackage{Sweave} \usepackage{amsmath} ...
Avocado's user avatar
  • 11
3 votes
2 answers
6k views

Tables with reference to R objects in sweave / latex

I'm using knitr/R-sweave to produce a pdf-document wit LaTeX-code. I want to make a table with some numbers produced by some R calculations in the R-code-chuck above this table. When I usually want to ...
Frederik Vitting Hermann's user avatar
1 vote
0 answers
848 views

general footnotes in xtable

I am using sweave to create pdf. Using xtable, I am trying to insert a general footnotes under the table (i.e: This symbol means bla bla bla). I've tried a lot of things and everything get me an error ...
Ludovic Auger's user avatar
2 votes
1 answer
462 views

Set TeXstudio for Unicode .Rnw files (Sweave)

I tried to run Sweave on a .Rnw file from TeXstudio, but the unicode characters don't show up in the .tex file when I typeset with xelatex. My user command is /usr/local/bin/Rscript -e "Sweave('%.Rnw'...
Stefano's user avatar
  • 865
1 vote
0 answers
66 views

Special Roman/Japanese Encoding with RStudio Sweave

Is there a way for having multiple enconding support in RStudio Sweave? I have the following citation, and using different encodings like uft8 or cjk just results in errors. Reference METI. (...
Amin's user avatar
  • 11
1 vote
1 answer
777 views

Including TikZ picture in Sweave gets me an overfull box error

I have some difficulties in R Sweave so I hope someone could help me. I want to include two TikZ pictures using minipage and figure to the R Sweave but I get an error: Overfull \hbox (2.43085pt too ...
Kyoto's user avatar
  • 13
0 votes
1 answer
138 views

xtable: extend table to both columns

Using the xtable package, is it possible to give some option to xtable function to generate a tex file which will contain following: ``` \begin{table*} ... \end{table*} ```
chao's user avatar
  • 135
1 vote
1 answer
3k views

Sweave R code chunk default colors in vignette

Typically, if I create a .Rnw file and add R code chunks to it, and then convert it to .pdf file, the R code text will have default color and font than the rest of the document text. An example ...
user12211991's user avatar
2 votes
1 answer
378 views

Conditional evaluation of Sweave chunk

I'm using some R code to import and manipulate a time series. The code takes some minutes to run and, as a result, it generates a relatively small time series. Now, to prevent typesetting to take an ...
Manlio's user avatar
  • 480
0 votes
1 answer
250 views

Do not use TAB (clear tab) at every new line -> flush both

Code .... \makeatletter \def\flushboth{% \let\\\@normalcr \@rightskip\z@skip \rightskip\@rightskip \leftskip\z@skip \parindent 1.5em\relax} \makeatother .... \...
b4154's user avatar
  • 157
2 votes
0 answers
341 views

Formatting text the same way knitr formats code, but outside of chunks

Back when I was using sweave, I could make my inline code look like R code by using \texttt{whatever} or \verb@whatever@. I am trying out knitr, and the format of the code chunks sure is pretty. But ...
generic_user's user avatar
1 vote
0 answers
80 views

Graphics prepared with Sweave and text disorder

I am preparing a report using Sweave, it is really beautiful, but the first introductory words of my pdf-file appear after the first R-plot! How to fix it? I would like to add that I've already tried ...
Mikitka's user avatar
  • 11
1 vote
1 answer
2k views

Table width 100% and changing font size

I want to size table to 100% but it has to be able to change the font size. [Purpose BEGINS here: achieve 100% width of table] print(xT, size="\\small", ...) [Purpose ENDs here]; xT is a table ...
b4154's user avatar
  • 157
2 votes
1 answer
498 views

knitr code chunks in footnotes

My issue is to include verbatim output from knitr Sweave code chunks in footnotes. The BVerbatim environment (fancyvrb) gives me the formatting that I want. (NB: one needs to put \VerbatimFootnotes ...
John Maindonald's user avatar
1 vote
1 answer
132 views

Setting up winefish to compile sweave

The winefish latex editor has a "texbox" field in the preferences window, which tells it how to do various things, like PDFlatex for example. There is something about regular expressions, a command ...
generic_user's user avatar
1 vote
1 answer
478 views

Sweave Print Codes without Considering the Width of Paper

I changed my paper size to A3 in order to make certain code chunk displayed without disruption. However, it seems that Sweave is not smart enough to detect the change of paper size and still break ...
LaTeXFan's user avatar
  • 1,573
2 votes
1 answer
2k views

Sweave-generated pdf-figure has two pages instead of one, with the first being empty

Using Sweave() in R I am trying to include a ggplot2-graphic generated by marrangeGrob() from the R package gridExtra into a pdf document. The problem occuring is that the pdf containing the figure ...
user3298179's user avatar
1 vote
2 answers
1k views

Add header and footer to each page from a pdf template

I have a document and I would like to include a header and footer to each page. The header and footer are at the top and bottom of an otherwise blank pdf file which is to be used as a template. Is ...
adam.888's user avatar
  • 229
2 votes
2 answers
516 views

Sweave: Floating Text and four tables anchored at bottom of the first page

I am trying to create a document that contains floating text that can extend over more than one page in length together with four tables that are anchored at the bottom of the first page (top left ...
soto888's user avatar
  • 21
4 votes
1 answer
2k views

Iterating through a character/string array in LaTeX

I have an array of strings, and am trying to output each element into LaTeX. I am able to achieve that using the following code: \documentclass[12pt,english,nohyper]{tufte-handout} \usepackage[T1]{...
user84756's user avatar
  • 319
2 votes
1 answer
139 views

Iterate latex/kintr code

I am new to knitr/Sweave. I need to prepare different versions of an exam with randomly generated questions. One version per student, each with the student's name on it. Below is a simple example with ...
Primo Petri's user avatar
2 votes
1 answer
412 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) ...
d.putto's user avatar
  • 281
1 vote
0 answers
866 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: /Library/...
user12211991's user avatar
0 votes
0 answers
821 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} \usepackage[utf8]...
Produnis's user avatar
  • 210
1 vote
0 answers
118 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 message. ...
MYaseen208's user avatar
  • 8,615
2 votes
2 answers
3k 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 ...
learner's user avatar
  • 123
1 vote
1 answer
811 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} \setcounter{...
user3603093's user avatar
2 votes
1 answer
675 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 ...
Erica D's user avatar
  • 141
2 votes
0 answers
272 views

Blog publishing / creation from Latex [duplicate]

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 ...
Shambho's user avatar
  • 443
6 votes
3 answers
2k 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 ...
kennyB's user avatar
  • 459
4 votes
1 answer
4k 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. ...
MYaseen208's user avatar
  • 8,615
1 vote
1 answer
1k 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: <<IMAG0387.jpg,fig=TRUE>...
limno_sam88's user avatar
2 votes
1 answer
4k 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, floating=...
user3387656's user avatar
1 vote
0 answers
80 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 ...
Mattis's user avatar
  • 83
7 votes
1 answer
15k 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 ...
JHowIX's user avatar
  • 299
4 votes
1 answer
981 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 tags also at the top of the rows and sides ...
d.putto's user avatar
  • 281
4 votes
1 answer
988 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. ...
JHowIX's user avatar
  • 299
3 votes
1 answer
469 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} \...
Robin Donatello's user avatar
2 votes
1 answer
312 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) ...
JHowIX's user avatar
  • 299
1 vote
1 answer
575 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()). ...
MYaseen208's user avatar
  • 8,615