R is an open source programming language and software environment for statistical computing and graphics. It is an implementation of the S programming language combined with lexical scoping semantics inspired by Scheme.

learn more… | top users | synonyms

0
votes
1answer
34 views

Two graph - same page? (R/LaTeX)

I am using R to create my graph, and I am doing a paper, where I have to put two graph, as showed in the image: In R, my output looks like: y1 <- c(6524, 6701, 6946, 7080, 6920, 6887, 6660, ...
2
votes
0answers
33 views

How to include LaTeX package in R Markdown?

I am writing a report with Rmd in RStudio via knitr package. I want to write a indicator variable symbol in the report, like How do you get \mathbb{1} to work (characteristic function of a set)?. ...
1
vote
2answers
37 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 ...
2
votes
1answer
47 views

A program to export latex tables to excel/ods/csv?

I know there are tools to export excel tables to latex, but what about the other way around? I get a lot of latex tables from functions in R (e.g.: texreg) that aren't perfectly customizable via the ...
3
votes
1answer
70 views

TikzDictionary slow and blocking in knitr

I need to knit presentations with many slides and Tikz-plots. Knitr is fantastic for this, but it takes very long time and I cant knit two reports in parallel. I have isolated the problem to the ...
4
votes
1answer
23 views

Howto: Set up knitr (*.Rnw compilation) from in TexStudio

How do I set up TeXstudio to compile xxx.Rnw files? I am using the TeX-Editor TeXstudio 2.7, on Windows 7, and R 3.01 64-bit. I would like to write a xxx.Rnw-file in TeXstudio and then from ...
1
vote
0answers
37 views

Sublime Latexing and Knitr on .RNW files : Send lines to R console for evaluation

I am using Sublime Text 3 and the Latexing package to apply Knitr to compile .Rnw files that contain both Latex and R code. Overall, it works well in that I can compile the .Rnw files into PDFs ...
1
vote
0answers
39 views

R assignment operator (“<-”)

How does one typeset the R assignment operator ("<-")? Workarounds such as \begin{description} \item[x \textless{}- c(1:3)] Create the vector [1 2 3] and assign it to an object named x. ...
4
votes
0answers
108 views

Best Practice for nice layout with tikzDevice

R+tikDevice+LaTex+knitr is (as I understand it) the most efficient way to get relly nice looking publications from R, with maximum layout-support from LaTeX. I'm using R+LaTex+knitr now, but would ...
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 ...
1
vote
0answers
34 views

Table-caption rotated wrongly

How can the table-description in tufte-handouts be placed correctly with sideways-tables and xtable? See following minimal reproducible example where the figure-description is corrrect (stolen from ...
7
votes
4answers
113 views

tikz has probably problems with czech babel when compiling .Rnw

Problem Tikz seems to have a problem with \usepackage[czech]{babel}. I had a moderately big .Rnw document written in czech with some plots via knitr chunks. When I set dev = 'tikz' the TeXmaker ...
0
votes
1answer
39 views

Chunk of text on the right of a picture

I have a portion of a latex document that is similar to: \begin{knitrout} \definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor} \includegraphics[width=0.5\linewidth]{figure/plot} \hfill{} ...
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 ...
1
vote
0answers
18 views

Include .Rtex as a chapter in latex

I have an Rtex that contains: \documentclass[openany]{book} \chapter{Introduction} \input{./Introduction/Introduction} \chapter{Thesis Outline} \input{./Outline/Outline_Chapter} ...
1
vote
1answer
42 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 ...
2
votes
0answers
68 views

Getting psfrag to work on ggplots with transparency [closed]

Right, so I'm using ggplot2 in R to create a graph that involves transparencies (no way around it I'm afraid). In Latex I use latex - dvips - ps2pdf to compile, because I also need psfrag (and ...
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 ...
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 ...
3
votes
0answers
103 views

Include R output as pdf in Texmaker

I just switched from texshop to texmaker on Mac OS X. However, now the plots I want to insert from R as pdf in the document are missing the fonts in the pdflatex output. It used to work fine with ...
4
votes
0answers
52 views

passing a String from an R Script to .Rnw template R code section ,brew/knitr

this is my first ever post and i am quite new to all of this, so i hope i am doing this right. my problem is the following: i wrote some R code to get some ID's from a Database, which are then used ...
2
votes
2answers
146 views

Pandoc-generated PDF contains large images, how can I make them fit into the page?

I am using pandoc to generate pdf output out of my markdown code. So far, it works fine without any warning or error, except the fact that figures are large, so that some figures get cut and don't fit ...
3
votes
1answer
47 views

lstlisting wrongly parse code as stringstyle (language = R)

please have a look at this picture. Could someone help me solve this please? As you can see, lstlisting sees my code chunk as string, which should not be the case (only stuff in quotes should be in ...
5
votes
0answers
88 views

TeX-function for writing R-functions

I'm working on an introductory course for the R-language in Latex, so I'm trying to write a Latex function that displays the R-function. This is what I've got: \makeatletter \newcommand{\fun}[3]{ ...
1
vote
0answers
190 views

How to reduce white space above/around R-Plot in LaTeX-Beamer document [closed]

Hi guys, my header looks like: \documentclass[8pt]{beamer} \usepackage[utf8]{inputenc} \input{ix-utf8enc.dfu} \usepackage[ngerman,english]{babel} \usepackage[T1]{fontenc} ...
0
votes
0answers
96 views

Packages for Typesetting Specific R Output

Anyone know of a package that translates R output into LaTeX code for the following types of commands? exp(w1$coefficients) exp(confint(w1)) My input/output with the xtable and stargazer R ...
3
votes
1answer
67 views

`documentclass` and required `packages` for compiling R help in tex

I got the help on R functions in .tex format using help_console function. I wonder what is the documentclass and required packages to compile this document correctly. Thanks in advance for your help. ...
3
votes
2answers
177 views

Suppress library comments from ouput with knitr

I noticed that some library comment manage to pass through the knitr options, with R 3.0.1 and knitr 1.5 running on Mac OSX 10.8.5. The following MWE \documentclass{article} \begin{document} ...
3
votes
1answer
753 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
97 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 ...
3
votes
1answer
49 views

latex R code with %*%

I'm using latex with lstlisting to format my R code. Some of my code uses matrix arithmetic, including %*%. Unfortunately this causes errors when compiling. There is an example of what I would like ...
2
votes
2answers
104 views

Double header in longtable

I'm trying to make a longtable and use some R tools for generating them. The problem is that when a long table has more than one columns, it creates double headers, as shown here: ...
3
votes
1answer
64 views

Vertical space only after every second row in a table

I have several tables in the following custom format, to which I would like to add vertical space (e.g. 6 pt) after every second row. I know this can be done manually. I am only wondering, if there is ...
3
votes
1answer
92 views

Macro to apply tabcolsep to a table from external file

I am using R to produce my tables via xtable, but I am not using Sweave to write my document. Instead I am using TexStudio and if possible would like to stick with it. Therefore I am using \input to ...
5
votes
0answers
173 views

Arguments of R Functions in Beamer with knitr

I'm using helpExtract.R function (can be obtained from here) to get arguments of R functions in Beamer with knitr. My (.Rnw) MWE is \documentclass{beamer} \usepackage{ragged2e} %new code ...
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
0answers
81 views

knitr yielding different output in pdf than in R console

I am running RStudio Version 0.98.484 and R version 3.0.2 on OS X Mavericks. While using knitr I noticed a discrepancy between the console output from a summary() command and that generated in the ...
4
votes
1answer
325 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} ...
3
votes
1answer
92 views

Produce 2 side-by-side tables from tables as external files (source: xtable in R)

Is it possible to put two tables next to each other, which are in separate .tex files, and added to the document via \input? If it's not, I could also create just the 'raw' contents of the tables, ...
4
votes
1answer
118 views

inputenc[utf8] error with input-function of external tex files

I got a problem with inputenc[utf8]. My document is in German and uses 'ä, ö, ü' which usually works fine with the following preamble: \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} ...
3
votes
1answer
113 views

R language parameters for `listings` package

I tried all answers posted here or on other pages, but nothing worked. I need to set the parameters for listings package to simulate R code, so: \usepackage{listings} \lstset { language=R, % ...
12
votes
2answers
298 views

TikZ: Regression Line with Residuals

Desired Output I made this diagram in R with ggplot2. Now I want to reproduce this diagram with Tikz. My MWE is: \documentclass[tikz]{standalone} \usepackage{pgfplots} \usepackage{pgfplotstable} ...
2
votes
2answers
165 views

Plot symbols from R as latex symbols

In a LaTeX document, I am including an image showing a plot generated by R, for example the result of a plot(x=1:5,y=1:5,pch=13). Is there a way to use this nice little symbol as a LaTaX character to ...
3
votes
0answers
237 views

How to keep ggplot font size constant when varying figure width

I have different figures across my document with different width. I set the the font size for all ggplots globally with theme_set(theme_bw() + theme(text=element_text(family="Palatino", size=20))) but ...
5
votes
1answer
38 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 ...
2
votes
0answers
54 views

knitr pdf search invisible text

I use the fantastic knitr to generate beamer-pdf’s with hundreds of slides of plots. Every plot shows data of different measuring equipment, so for example the plot showing result of measuring ...
3
votes
0answers
79 views

Fontsize with knitr & tikzDevice

I saw there are already a couple of questions on the argument (here and here) but since they are a few months old and since I can't manage to make the option dev.args=list(pointsize=5) works even ...
2
votes
2answers
262 views

How to draw a graph by indicating volume of 3D elements but not their position

I have about five thousand observations which I would like to plot in a graph. Since the range of values is wide (from 1 to 108,000, with 90% of the observation taking a value of 2, 99% of the ...
4
votes
0answers
89 views

How to mantain consisten font size in different plots

I usually embed numerous R plots in my TeX documents. knitr is very handy in helping me producing plots using the same font family of the TeX document. But a different problem of consistency is given ...