Tagged Questions

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

2
votes
1answer
15 views

RStudio problem with xtable “results=tex”… “object tex not found”

I am using the 'compile pdf' button in a .Rnw file in Rstudio, including the following: <<longterm1, results=tex, echo=FALSE>>= print(xtable(longterm), include.rownames=FALSE, ...
3
votes
1answer
32 views

\mathplus fails to render

I'm new to LaTeX - can anyone suggest why the $\mathplus$ is not rendering as +? It can be seen in the bibliography entry of another question, publisher = {Springer Science $\mathplus$ Business ...
3
votes
0answers
90 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 ...
0
votes
0answers
32 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
57 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 ...
2
votes
0answers
97 views

To get this WordCloud and R working in OSX's Texpad -1.6.0

I am trying to this Hamilton's code about WordCloud, which uses R, working in OSX. I have latest XCode and latest R 3.1.1 (XCode5 support) installed. Texpad 1.4.7-1.6.0 problem I open TexPad with ...
5
votes
1answer
61 views

Can you specify a word separator for variables in listings?

Depending on the language specified, the listings package may or may not bold keywords inside of variable names. Python is fine \documentclass{article} \usepackage{listings} \begin{document} ...
2
votes
1answer
69 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
1
vote
1answer
519 views

Knitr and rmarkdown will not add figure captions to the output

I am writing a report on Rmarkdown and knitr using RStudio, and cannot find a way to get figure captions on my document. My code for the chunk where I try to plot is like: ```{r ...
3
votes
2answers
116 views

knitr sanitises the % marker for LaTex comments and they show up in the final document

I am writing a knitr document using xtable to get my tables. Xtable inserts by default a comment saying: "latex table generated in R 3.1.0 by stable 1.7-3 package % Thu Sep 18 14:19:21 2014" This ...
1
vote
0answers
74 views

What do you use for plotting? [closed]

I use Latex now for about two years and have written a couple of larger documentations with it. When it comes to plotting (simple or complex, functions or data) I used gnuplot or R. The later more and ...
1
vote
1answer
34 views

fragile/verbatim R code inside probsoln when using an exterior Rnw file for the data sets

A follow-up on this question about using R code inside the environments used in probsoln package. If you uncomment out the section below and define the problem within the main Rnw file, the R code is ...
1
vote
0answers
86 views

Best practice for ggplot transparency in pdf figures

I lost a couple of hours because of few transparent figures which Adobe Professional couldn't flatten to print (it crashed in the process). I wonder if there's any trick to produce PDF figures with ...
1
vote
1answer
37 views

Justifying the output of toLatex function of utils R package

Using utils::toLatex(sessionInfo()) in .Rnw we can get R Session Info to put in LaTeX. I would highly appreciate if someone guide me to fully justify the output of utils::toLatex(sessionInfo()). ...
0
votes
1answer
93 views

How can I include the R source code in the appendix?

I really have no idea how to include the R code into latex, so I only can provide my R code. I would like to put it in the appendix. I am really looking forward to your help. Thx! The codes will show ...
2
votes
2answers
113 views

Getting `tables` R package to print a text file that I can import into my .tex file

I'm trying to write some R code that takes data from my (evolving) experiment, makes a summary statistics table, and inputs it into the .tex document that I'm writing. I want to avoid copy-pasting. ...
0
votes
1answer
93 views

Sweave and R 3.1.0: no pdfs generated

After upgrading R to version 3.1.0 (from some version 2.x.x), the following sweave code does not produce any pdfs for the plots anymore: \documentclass[a4paper,10pt]{article} \SweaveOpts{echo=FALSE} ...
0
votes
0answers
61 views

Convert .R into Latex

I'm really new at this and I couldn't found any realted subject. So I've created my .R file where I generate my graphs from my data: barplot(wmaefile$FC,xaxt="n",col="snow2",border="black", ...
2
votes
1answer
84 views

Avoid R output leaking into LaTeX with ggnet

Please consider the following MWE which I compile into a .tex document via knitr \documentclass{article} \begin{document} <<echo=FALSE, message=FALSE, warning=FALSE>>= library(igraph) ...
2
votes
0answers
81 views

knitr: Several figures with subcaptions, alignment issues

Here is a minimal working example: \documentclass{article} \usepackage{subfig} \begin{document} <<echo=FALSE,out.width="0.49\\linewidth",fig.show="hold",fig.align="center",fig.cap="Some ...
1
vote
0answers
65 views

Knitr and numbers

I return to a question, which is few months old and then maybe not yet the best practice around. I use the siunitx package in my documents along with knitr to compile my R chunks. As far as I ...
3
votes
1answer
88 views

Memory issue when producing dense TikZ figure (14500 points scatterplot) with knitr

I have a series of plots in my document which are correctly drawn by knitr with dev=tikz. Yet figure number 7, which is much more dense than the others in terms of data points, foo, doesn't: label: ...
1
vote
1answer
88 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
2answers
134 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
168 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
226 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
122 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
113 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 ...
2
votes
0answers
173 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
122 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
115 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
128 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
68 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
59 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
108 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
63 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
89 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
1answer
171 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
93 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
117 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
99 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, ...
7
votes
2answers
1k 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
103 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
113 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
2answers
190 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
463 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 ...
2
votes
2answers
353 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
127 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
499 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
206 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 ...