knitr is an R package for dynamic report generation based on the concept of literate programming.

learn more… | top users | synonyms

0
votes
0answers
6 views

Fill arbitrary number of “template analysis page” based on data output by R

I'm using knitr to produce a report on anomalies detected in a machine. I've got an R script that searches for anomalies (there can be an arbitrary number of anomalies) and the script also produces a ...
1
vote
1answer
31 views

Install knitr on own shareLatex server

EDIT: According to a ShareLatex Github discussion, I should create a .latexmkrc file and add the following code (I tried already in the home directory but it didn't work) : my $root_file = ...
1
vote
0answers
24 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) ...
1
vote
0answers
26 views

How can I remove extra spaces in code passed through probsoln package?

This is an easy question to a potentially complicated situation. I'm using RStudio to write homework and exams using the probsoln package that embeds R code into the LaTeX directly. I am using knitr ...
3
votes
1answer
33 views

Input Tex file in knitr file

I am showing a simple example here just to frame the question. \documentclass{article} \begin{document} <<>>= library('ggplot2') dataset <- diamonds @ \begin{table}[htbp] ...
2
votes
1answer
56 views

How to use Umlauts (äüö) in axis label with knitr, LuaTex and tikz?

When compiling pdf documents with complex tikz figures using knitr, the pdftex engine would sometimes run out of memory. Thus, I used the luatex engine to compile these Rnw files. However, I am not ...
2
votes
2answers
31 views

shrink knitr output to multiple columns

I am providing a very simple example here. In my dataset, I have 50+ names in column. I get annoyed by the fact that colnames() output takes 50+ lines too! Is it possible to divide the output over ...
1
vote
1answer
36 views

chunk on a new page in knitr

I have a situation where i am knitting a bunch of figures in \enumerate and figures are big such that I would prefer one page for every figure. \documentclass{article} \begin{document} ...
0
votes
1answer
52 views

Modify R output in LaTeX

I'm currently writing a paper for my bachelor thesis with LaTeX. I'm pretty new to LaTeX and I was wondering whether I can modify the R output in LaTeX. For Example: If I type in this: ...
1
vote
1answer
74 views

Creating Bold Column Headers using xtable (knitr)

what is the easiest way to bold all column headers using the output of calling xtable, ideally under the print.xtable command. I am using knitr.
2
votes
2answers
68 views

bundledoc fails with subfolder paths (MiKTeX)

I would like to use bundledoc mainly in Windows with MiKTeX. However, I encounter a problem with subfolder paths that is annoying. I run the program as follows: bundledoc --config=miktex.cfg ...
1
vote
1answer
66 views

Capturing final figure caption using knitr

I'm writing a paper for the journal PLOSone. They require that figure captions be placed in the article but not the figure itself (it's submitted separately). So I'm wondering how to get knitr to ...
2
votes
0answers
62 views

R-code linebreaks AND themes in knitr

hpesoj626 provides two great minimal working examples for how to get R-code linebreaks AND code highlighting in knitr. I was wondering if it was possible to use Yihui's knitr themes within either of ...
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
40 views

R data.table and knitr

I have an automated report that i produce using knitr. i'm running across the oddest problem. I wrote a function that sums the data by month for several locations. when i run this function in R i ...
0
votes
0answers
25 views

Unwanted white space with knitr+booktabs package

I want to include a table in my latex document that I create using knitr package. I "call" the table using: \begin{table}[H] \begin{centering} <<r second part}>>= kable(Per_cond, ...
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 ...
1
vote
1answer
47 views

Why does this fail in LyX 2.1.3 but works in .Rnw?

This code works fine in .Rnw but does not work in LyX 2.1.3. In LyX 2.1.3 it throws the following error: Error in getModel.baseGmm(all_args, ...): could not find function "is" Any idea how to ...
1
vote
2answers
173 views

knitr in RStudio produces 'Undefined control sequence', alongside other issues

I am getting multiple issues being reported when I try to 'Compile PDF' for a knitr document in RStudio (Windows 7), although the .pdf is still produced in the working directory. I am using R 3.1.3, I ...
5
votes
0answers
83 views

What are the advantages of switching to Emacs for TeX/knitR work?

Currently, I am using TeXStudio. Now, I am considering to switch to Emacs because I heard that is has its advantages when it comes to R and knitR. But what are the specific advantages? Yet, I am still ...
0
votes
0answers
106 views

utf8 encoding problems with knitr

I'm using RStudio 0.98.1102 on Windows 7 with knitr 1.10 (R 3.1.2) and tried to knit the following file: \documentclass{article} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} ...
0
votes
1answer
39 views

knitr-manual.lyx fails to compile on LyX 2.1.2

My error message gives me the following: An error occurred while running: Rscript --verbose --no-save --no-restore "C:/Program Files (x86)/LyX 2.1/Resources/scripts/lyxknitr.R" ...
0
votes
0answers
109 views

Best way to Insert R code into a LyX document

Let's suppose that I have a set of R (3.1.2) scripts that I would like to display in LyX (2.1.2). I could use Program Listings, but I think this looks very unprofessional. I am wondering if anyone can ...
2
votes
1answer
55 views

Insert knitr (1.9) Chunks From Separate File Into Lyx (2.12) Document

I have a LyX document (report class) called mwe.lyx and I would like to execute the following Rmd chunk called "mwe.Rmd". {r, eval = FALSE, echo = TRUE, cache = FALSE} 2+2 Of course, I can ...
2
votes
1answer
82 views

How to modify knitr output chunk

I know that it's possible to tweak the output of a knitr code chunk so that it looks the way you want. My problem occurs when using the parskip package. The parskip package adds an extra bit of space ...
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
42 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
120 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 ...
1
vote
0answers
143 views

Problem using tikzDevice in knitr

I can't seem to get knitr to work with tikzdevice. A simple example: \documentclass{article} \begin{document} <<test, dev='tikz'>>= library(knitr) library(tikzDevice) library(ggplot2) ...
2
votes
1answer
207 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. ...
0
votes
0answers
44 views

How to cleanly post-process PDF compilation in AUCTeX and ESS?

This question is somewhat related to this one, but separate. Thanks to Jan Gleixner's utility, One can obtain synchronization between a source foo.Rnw compiled by knitr and the resultant foo.pdf. ...
1
vote
1answer
67 views

Auctex evince synchronization problematic with accented characters in file paths

I recently stumbled on this nice problem (bug ?) : I can use evince to visualize foo.pdf output from LaTeX obtained in AUCTeX and Synctex synchronization,as long as none of the files referenced in ...
4
votes
1answer
101 views

Pass a class/package/theme option to R with knitr

I have a beamer document with R chunks, say 'template.Rnw', which I compile with knitr using 'compile PDF' in RStudio. I have defined a theme 'mytheme.sty'. I would like to have an option to the theme ...
0
votes
1answer
138 views

Which software should I use for making high quality graphs? [closed]

I have written a paper in MS-Word. Now, I am converting it into LaTeX. The problem that I am facing is about figures. Some of the figures I have converted using Adobe Illustrator. However, since I ...
1
vote
0answers
70 views

How can I show a caption, subcaption and source similar to this NY Times style?

I would like to create a LaTeX document that mimics the style used on the NY Times' Upshot Blog (example at NY Times). Here is the desired output: They have these features: A thin gray line ...
2
votes
1answer
129 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: ...
1
vote
1answer
153 views

How to include a .TeX file generated from .Rnw file into a .TeX file which is child of parent .TeX file?

I really need help. Here is the 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 ...
2
votes
1answer
132 views

knit() doesn't create .tex file with necessary preamble

I have a question about creating .tex from .Rnw using knitr in Rstudio. I have a test.Rnw file while looks like the following: \input{report_preamble_en.tex} \title{test} \author{author} ...
3
votes
0answers
145 views

tikz stops drawing into pdf after 20 line segments in plot generated through knitr tikzDevice

Problem If I try to draw a curve generated through knitr using tikzDevice into .pdf only 20 line segments of that curve are drawn and TeXstudio, through which I do it, just leaves message running ...
1
vote
1answer
132 views

SumatraPDF inverse search for RNW files

I'm using TexStudio to edit my rnw files. I setup an inverse search from SumatraPDF to TexStudio using THIS (verbatim) which is a renewed version of THIS. When I double click a text in SumatraPDF it ...
1
vote
1answer
139 views

How can I nest a code chunk within an enumerate environment when using R Markdown?

When I attempt to do this using this code: --- title: "Title" author: "Me" date: "31 October 2014" output: pdf_document: includes: in_header: includes.sty --- ...
2
votes
1answer
187 views

Special characters and math-mode in tikz graphics using knitr

This question closely relates to this one: Using '$' in a tikz plot generated by knitr I am able to get tikz graphics using knitr working with either math mode as in this post: Math mode in ...
1
vote
0answers
93 views

Force Knitr Figure on same page

I am using Knitr on RStudio. <<glmall, include=TRUE, fig.align='center', fig.cap='Diagnostics plots for full-model with GLM (Poission)', fig.show='asis'>>= par(mfrow=c(2,2)) ...
1
vote
1answer
69 views

Using geom_segment dashed line has odd behavior when using tikz device

My example is: \documentclass[12pt]{article} \begin{document} <<eg, dev='tikz', size='normalsize', echo=FALSE, message=FALSE, warning=FALSE, sanitize=TRUE>>= require(ggplot2) p1 <- ...
0
votes
1answer
73 views

Using '$' in a tikz plot generated by knitr

My example is: \documentclass[12pt]{article} \begin{document} <<eg, dev='tikz', size='normalsize', echo=FALSE, message=FALSE, warning=FALSE>>= require(ggplot2) ggplot(cars) + ...
6
votes
1answer
3k views

no tex installation detected on RStudio after OS X 10.10 yosemite upgrade

I upgraded my MAC to OS X 10.10 yosemite today. Now, when I run RStudio and try to use Knitr to compile pdf, it says no text installation detected. So, I did the following steps sequentially. ...
0
votes
0answers
30 views

LaTeX keeps placing floats above section headlines

I followed the accepted answer to the question on how to Start new page with each section but LaTeX still puts a float object on the top of a page, above the section headline. Instead, I want this ...
3
votes
1answer
363 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
350 views

How to print a table and figure side-by-side in knitr

I see a lot of posts on putting figures side by side with tables without knitr, and posts about putting tables next to tables and figures next to figures in knitr, but nothing on how to put a figure ...
2
votes
1answer
184 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