Questions tagged [rnw]

.Rnw is a file extension used for documents with markup and and/r chunks.

determines the appropriate set of patterns (regular expressions) to use to extract code and chunk options based on the file extension (if the patterns are not provided in advance). See ?knit_patterns for more information.

84 questions
2
votes
1 answer

Knitr asis not working with output from hooks

In Rnw/LaTeX one use of the common output from knitr hooks might be decorating with some fancy environment the data from chunks. For example code specific to chunk can produce core data for tables and the hook code before and after provide the…
antonio
  • 10,629
  • 13
  • 68
  • 136
2
votes
0 answers

Sweave not generating figures

I am trying to include figures in my Sweave report. I have a file a.Rnw: \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{document} <
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
2
votes
1 answer

knitr Rnw latex: how to obtain a figure and caption in landscape mode that's full page width

I am trying to produce a full-page figure along with a caption in landscape mode. The Rnw file below works fine if I omit "fig.cap='Caption Trial'", but not if the caption is used. Any help would be greatly…
2
votes
1 answer

Jump to position in .Rnw file in PDF produced by knitr

I'm using knitr to convert .Rnw files to .pdf files. I can use Skim to jump from a position in the .pdf file to the .tex file produced by knitr. How can I jump from a position in the .pdf file to the .Rnw?
luciano
  • 13,158
  • 36
  • 90
  • 130
1
vote
2 answers

How to handle the overlay of kable output with page number?

I use kbl() function, in a rnw file that I compile in a pdf with knitr, to make a table starting from a dataframe. I use kableExtra option scale_down to adapt the table size to page size. It works fine but the table overlay with the page number of…
Vincenzo
  • 145
  • 1
  • 6
1
vote
1 answer

Reproducible Longitudinal report writing

Reproducible Longitudinal report writing I'm trying to write a report which looks at longitudinal data, and analyzes those data in the same way each time. Because of the nature of my data (they include network objects generated within igraph), I…
1
vote
1 answer

Use isotope latex-package inside Rnw (r-exams)

I want to load and use isotope package in my .Rnw file: \exname{foo} \extype{schoice} \exsolution{0001} \usepackage{isotope} \begin{question} Foo \isotope[A][Z]{H}\ bar \begin{answerlist} \item a \item b \item c \item d …
uzsolt
  • 5,832
  • 2
  • 20
  • 32
1
vote
1 answer

knitr Rnw file have optional output in child

I use Rnw files to create exams for my students, I put separate quiz into child Rnw file and include them in the main Rnw in the way <>@ The xx.Rnw contains the problem statement and also the answer. I want to have two versions of…
sunxd
  • 743
  • 1
  • 9
  • 24
1
vote
0 answers

Error compiling .Rnw files in RStudio: Issue with project path?

When I try to compile a PDF from an Rnw file in RStudio, I receive the following error: Loading required package: knitr Error in readLines(if (is.character(input2)) { : cannot open the connection Calls: knit -> readLines In addition: Warning…
der_grund
  • 1,898
  • 20
  • 36
1
vote
1 answer

Conditional output of dynamic text in a LaTeX knitr document

I'd like to print a few sentences in a knitr LaTeX doc (.Rnw), but only if some data exists. Those sentences are mostly text, but with some R. Example: A chi-squared test of your observed sizes has a p-value…
dfrankow
  • 20,191
  • 41
  • 152
  • 214
1
vote
1 answer

Knitr hook to postprocess pdf output?

I have foo.Rnw file which uses the extrafont package for generating figures with text elements that use non-standard font families. After knitr calls pdflatex on my document, I want to run extrafont::embed_fonts on the resulting foo.pdf file. I can…
Jonathan Gilligan
  • 701
  • 1
  • 5
  • 21
1
vote
1 answer

knit to pdf in emacs using polymode

I am trying to knit my Rnw file into PDF. With ess-noweb mode, I could knit and view the pdf but with polymode, I could knit to tex with name filename[woven].tex but could not view the pdf. Do I need to open the tex file again and compile it or is…
TheRimalaya
  • 4,232
  • 2
  • 31
  • 37
1
vote
1 answer

How to use conditional eval using Knitr in a rnw file

I want to use a conditional eval for a code block in a rnw file using knitr. when i run the official example: knitr-examples/011-conditional-eval.Rnw \documentclass{article} \begin{document} \SweaveOpts{concordance=TRUE} <>= # this…
Robin
  • 59
  • 6
1
vote
0 answers

Remove white spaces before and after an image

I set echo = false in .Rnw file with knitr. The output is a graph with lots of white space around it. How do I decrease the white space so that the graph is not too far away from the main text?
green_C
  • 59
  • 1
  • 6
1
vote
1 answer

global.par = TRUE not working in knitr for bg in RSweave doc

I need to change the background of all tiff images produced by my R Sweave document and encountered the same problem as described here: Respecting global options in knitr but with par(bg = ), which supposedly is working according to a…
jtr13
  • 1,225
  • 11
  • 25