4
votes
1answer
27 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 ...
0
votes
0answers
30 views

Can I produce a .tex file from .Rnw? [on hold]

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 ...
4
votes
1answer
35 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 ...
2
votes
1answer
90 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 ...
5
votes
2answers
95 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
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 ...
1
vote
1answer
49 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 ...
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 ...
4
votes
0answers
121 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 ...
2
votes
1answer
98 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 ...
6
votes
1answer
160 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 ...
0
votes
1answer
147 views

Special characters in knitr generated figure caption

I would like to pass special characters and formatting with the knitr generated captions. I am trying to understand two things: 1) Is it possible to pass LaTeX syntax through the caption? 2) How ...
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 ...
1
vote
1answer
248 views

How to debug if Knitr quits unexpectedly when composing tikz figure

I have a .Rnw file that Knitr used to compile perfectly fine until my backend dataset changed. Probably then the size of the graph changed also. For reasons I don't understand knitr now stops abruptly ...
2
votes
1answer
99 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 ...
2
votes
1answer
93 views

How to escape inline R command to avoid issue with “while-typing” spelling check

I have a problem with my text editor Aquamacs Emacs (GNU Emacs 23.4.1) when use it with \Sexpr to print inline the output from R functions. The problem results when the R command includes special ...
5
votes
1answer
454 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 ...
6
votes
1answer
506 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 ...
3
votes
1answer
222 views

Is there a PythonTex equivalent to \Sexpr{} in R?

I started to use the excellent PythonTex package to write reproducible reports but can't seem to get it to evaluate Python code inside a LaTeX command. R has Sweave & knitr which provide the ...
2
votes
1answer
283 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
706 views

Sweave and Matrix

I am using xtable to generate Matrices x1mean <- matrix(c(204.5, 556.5), 2) x2mean <- matrix(c(130.0, 355.0), 2) x1mmat <- xtable(x1mean, align = rep( "", ncol(x1mean) + 1) ) x2mmat <- ...
0
votes
1answer
124 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 ...
0
votes
1answer
684 views

Looping a code-chunk in LaTeX

I want to generate a report for three types of analysis I am performing. But each time when I perform the analysis it can happen that one or more than one type of analysis occur. I want to put ...
2
votes
1answer
217 views

Rstudio output in Hebrew

(Follow-up to Making LaTeX documents with Hebrew? (in Sweave + RStudio)) Trying to reproduce the above answer, I followed these instructions without success, under Windows 7. The best result I got ...