1
vote
1answer
24 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
45 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
40 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", ...
2
votes
1answer
49 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
1answer
52 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
73 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.
1
vote
1answer
30 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
69 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} ...
2
votes
1answer
57 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
2answers
76 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
93 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
1answer
609 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
65 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 ...
0
votes
0answers
62 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 ...
3
votes
1answer
2k 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 ...
2
votes
1answer
191 views

How to loop over R objects OUT OF chunks

I want to typeset with TeX a report based on data from an R object (dataframe). The idea is to print a nice TeX table from each line of a R dataframe. Something like \begin{tabular}{ l c r } A1 ...
7
votes
1answer
259 views

Is it possible to get Sweave/knitr in RStudio to output the .tex file without typesetting it?

I would like to know if it is possible to tell Sweave or knitr in RStudio to create the .tex file without trying to typeset it. I want to be able to run my .Rnw file and produce a .tex file which I ...
5
votes
1answer
825 views

longtable misplaced noalign

Question Why am I getting multiple misplaced \noalign errors? Reproducible example \documentclass{scrartcl} \usepackage{longtable} \usepackage{booktabs} \begin{document} \section{Table test} ...
5
votes
1answer
52 views

How can I figure out which parameters are passed to xelatex by Rstudio?

I'm using Rstudio to create a nice pdf report using sweave and xelatex. I can process the sweave file in Rstudio, but I'm trying to wrap this into a script, so I need to figure out what parameters are ...
0
votes
0answers
28 views

How to prevent plots being printed out of document's sections? [duplicate]

I am preparing a document using knitr in which I have multiple charts within two or more sections. The majority of the plots is printed at the end of the document but I would like them to stay within ...
5
votes
1answer
352 views

Selectively suppress caption numbering when using xtable

I have a chunk of code which is producing table output using Xtable and I would like to suppress the table numbering. I know I can suppress numbering using \caption* outside of Xtable but I'm stumped ...
8
votes
2answers
228 views

What tools are there to make LaTeX more viable at work

I do data mining in R, Python and various object oriented languages. I like using LaTeX to present my results; either to myself (i.e. use them for result interpretation/analysis) or to send to ...
3
votes
1answer
803 views

Sweave on Windows 7 - using Texmaker

So I've tried to configue Sweave on Texmaker following these instructions: http://arts.uwaterloo.ca/~tmparker/722/hw/Setup_Sweave_in_Texmaker.pdf When I go to run this example: ...
2
votes
1answer
157 views

knitr compiling time with large datasets

I noticed that with a large dataset knitr takes an unexpected long time to compile my document: about 23 minutes from when knitr completes the last chunk to when it writes the .tex. I don't understand ...
1
vote
0answers
77 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 ...
2
votes
1answer
593 views

Plots are not appearing in PDF after using Sweave

In general, Sweave is making great looking PDFs for me. However, when I plot a histogram, it is not appearing in my PDF. I have a bare bones Sweave document as follows. I can't seem to isolate ...
1
vote
2answers
854 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 ...
7
votes
1answer
965 views

How to build Knitr document from the command line

I would like to compile a knitr document from the command line. With Sweave, the sequence R CMD Sweave my_sweave_file.Rnw latex my_sweave_file.tex latex my_sweave_file.tex dvips my_sweave_file.dvi ...
2
votes
1answer
316 views

How to add horizontal lines within a table created by Hmisc::latex()?

lets suppose we have a table given in R and use the function latex() from the R package Hmisc to include the table in a Sweave (or knitr) document. My question is: Is there a way to add horizontal ...
9
votes
2answers
897 views

Building TeX file from knitr Rnw as child of larger parent TeX file to use R objects and output

Here's my general problem: I'm writing my dissertation using a LaTeX template (http://www.latextemplates.com/template/masters-doctoral-thesis). The template is a parent file with multiple chapters as ...
2
votes
1answer
129 views

How can one make RStudio pass options to Sweave()?

I'm trying to use a UTF-8 encoded .Rnw file in combination with xelatex in RStudio. Since xelatex uses native UTF-8 support i cannot use \usepackage[utf8]{inputenc} in my .Rnw file, which would ...
3
votes
1answer
259 views

How can I center a Sweave verbatim chunk?

I have a very simple sweave chunk with two lines, like this: <<results=verbatim>>== quantile(foo$bar) @ How can I center this element? I've tried embracing the chunk with \begin{center} ...
1
vote
0answers
1k views

Fatal error occurred, no output PDF file produced in php file [closed]

We are using following code in .php script for generate .pdf file. $result1 = exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw"); $result2 = exec("pdflatex /var/www/html/r/r_latex_sweave.tex"); ...
0
votes
0answers
1k views

Fatal error occurred, no output PDF file produced [duplicate]

we are executing following code from .php file. $result1 = shell_exec("R CMD Sweave /var/www/html/r/r_latex_sweave.Rnw"); $result2 = shell_exec("pdflatex /var/www/html/r/r_latex_sweave.tex"); But, ...
3
votes
1answer
541 views

How can I insert Sweave code inside a Beamer block?

I'm currently trying to automate a report-generating routine in R, and I imagine the best way to try this is through Sweave and beamerposter. The report should have one page with several sections in ...
3
votes
1answer
240 views

Sweave outputs gibberish

I have this .Rnw file: \documentclass{article} \begin{document} <<>>= data(cars) fit <- lm(cars$speed~cars$dist) summary(fit) @ \end{document} I am using RStudio to build the PDF ...
2
votes
1answer
447 views

insert figure in sweave using knitr fig.path

I'm trying to insert a figure using Sweave which is located in the path C:\Users\eccehomo\Documents\mi\fig1.png. I'm using the package knitrwhich has a function called fig.pathbut I'm getting many ...
1
vote
1answer
175 views

How to print a system of linear equations in matrix form using sweave?

I would like to print a system of linear equations, a right bracket, a right arrow and finally the output of the system (x). Something like Ax = b } ---> x. It is hard for me to find the right way of ...
1
vote
0answers
44 views

Citations not working in Sweave [duplicate]

I am trying to run this Sweave code in R. \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} \section{Section} I am citing \cite{ftest}. \begin{thebibliography}{9} ...
2
votes
1answer
351 views

\Sexpr shows only one value from a vector with two elements in sweave

I can't get the two elements of the vector using: <<>>= z=c(1,2) @ \Sexpr{z} I have googled a lot but don't understand why I get just the first element.
2
votes
1answer
221 views

Doodle on top of Sweave output

It might not be possible to do this, but I was wondering if there is a way to doodle on top of the LaTeX output, or in my case on top of Sweave output. See example underneath!! ...
2
votes
1answer
166 views

PDFLaTeX produces black boxes after executing Sweave

There is the following code \documentclass[a4paper]{article} \begin{document} hey there <<>>= 1+1 @ \end{document} I saved the example.Rnw in my home directory an ...
0
votes
2answers
236 views

How to remove name while including image in LaTeX?

I am including an image in R and found the name of the image file appearing with the image: name<-c("A.pdf","B.pdf","C.pdf","D.pdf") <<echo=FALSE,results=tex>>= for (i in 1:4) ...
1
vote
2answers
307 views

Sweave documents: saving output for later use

I am fairly new to the idea of sweave documents. My document is a .Rnw file containing LaTeX code and R code. Part of my R code is computationally intensive and delays the compilation of my .Rnw ...
1
vote
1answer
166 views

Sweave: How to remove horizontal space in Soutput environments?

As the following example shows, there is a horizontal space added in the Soutput environment. This leads to a non-left-aligned output (see the output of rnorm(). I found that this space already exists ...
5
votes
1answer
533 views

How to randomize content with examdesign package using Sweave

Forgive me in advance if this is a dumb question, or too specific to one package. I've been using examdesign to randomize the order of questions, but I also want to randomly generate the content. I've ...
0
votes
1answer
140 views

Question mark in knitr code getting quote marks [closed]

I'm trying to use question marks in a code block using knitr, but in the compiled pdf always puts quotes around it, so, for example <<helpCode, eval=FALSE>>= ?rnorm @ comes out as ...
1
vote
1answer
265 views

How to obtain Sweave(l) listings with rounded corners?

I downloaded the Sweavel.sty-File from here: http://biostat.mc.vanderbilt.edu/wiki/pub/Main/SweaveTemplate/Sweavel.sty Now, for a modern look, I would like to produce rounded corners in the R code ...
5
votes
1answer
132 views

Sweave Float environment over 2 pages

I have a bit of Sweave code as such: <<label = Example1, echo= true>>= //Bunch of R Code @ I've tried putting it in my own float environment like so \newfloat{rcode}{h!}{rcode} ...