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

1
vote
1answer
19 views

Cross-referencing tables generated by xtable

I'd like to cross-reference a table that I generated with xtable in R. I cannot able to. Here is what I did: \documentclass{article} \begin{document} Look at \ref{tab:mytable}. ...
2
votes
1answer
26 views

How does one set document class options (e.g. paper size) for LaTeX output?

The header option lets you insert TeX code in the preamble after \documentclass{article}, but what if I want to change the default paper size or the default font size? For this, I would need to ...
6
votes
1answer
127 views

How can I delete non-letter keywords (such as '<-')?

I am using the package to try and format my R code, and I don't like some of the things that are being treated as keywords (for the coloring scheme). However, when I specify deletekeywords={*,<-} ...
4
votes
1answer
195 views

A TeX translation of old C code - Evaluating elements of an array *inside* a foreach loop

I'm trying to translate a conceptually simple part of an algorithm, from the original source for the R-engine (written in C) to TeX. This shouldn't take more than some logic trees and for/while loops. ...
4
votes
2answers
95 views

Large image should ocupy all page without blank space around

I'm new to LaTeX and although my supervisor does not use LaTeX, I've decided to do my master thesis in LaTeX. However, I'm having a problem with the images. I have big images generated through R. ...
1
vote
1answer
52 views

Removing hline when producing latex code for table in R with Hmisc package

I have been struggling with this for some time and can't really find an answer. By default the latex command in Hmisc package cab generate code for table with hline on top, below header row and after ...
1
vote
0answers
62 views

Configure R Studio to use Biber for APA on Beamer Slides (Biblatex + Biber + R Studio + MiKTeX)

I'm trying to generate with R Studio a beamer presentation that uses backend=biber option. Here is my MWE: \documentclass{beamer} \usepackage[american]{babel} \usepackage{csquotes} %apa requires ...
1
vote
1answer
38 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
56 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
12 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} ...
2
votes
1answer
19 views

Latex ifFileExist

\subsection{Checksum: Factor, Specific, and Total Variance} Perhaps the most basic test of a regression model is if the factor and specific variances sum to equal the total variance. Here, we ...
0
votes
0answers
30 views

Place multiple tables in a grid on a single page

I need to show several tables and figures on a single page. They are of different heights and widths and I would like to build a grid in which I could then put them. Is there a package that would ...
4
votes
3answers
82 views

knitr. Splitting a function into several blocks

Is it possible with knitr to split an R function across several blocks (for documentation reasons)? Here is a MWE: \documentclass{article} \begin{document} Part1 gives salutation. ...
2
votes
0answers
48 views

R figure to LaTeX - cloudy and diffuse text [closed]

I am a newbie to R and LaTeX, and cannot find any hint for my problem. Perhaps it is a silly question, but I tried to get a R-diagram into my LaTeX document without the axes out of focus. So far so ...
3
votes
2answers
56 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} ...
0
votes
0answers
56 views

“Math Processing Error” when processing LaTeX using knitr in R

I've never had any problem with my Latex appearing properly when using knitr before, but recently when I compile my document, I get this error: I'm not sure why this is happening. The error output ...
2
votes
1answer
45 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: ...
3
votes
1answer
87 views

How to plot barplot horizontally in LaTeX

I want to plot a barplot horizontally. I have tried using the following code, but it prints a vertical plot: \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{pgfplots} ...
0
votes
1answer
58 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
120 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
66 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
70 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
112 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 ...
5
votes
1answer
122 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
94 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
54 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. ...
7
votes
1answer
240 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
67 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 ...
1
vote
0answers
45 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
153 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
45 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
390 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
26 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
61 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
98 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
51 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
51 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
149 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
1answer
96 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
372 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
101 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
115 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
235 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
172 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
78 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
509 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
1k 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
154 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
53 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
136 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: ...