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
18 views

knitr creating a wrong second “#” in a deep hyperlink

I would like to compile a .Rnw Document in RStudio with knitr that includes a "#" in the hyperlink (deeplink) of a float caption. See the minimum working example: (compiled with R Studio Version ...
3
votes
1answer
212 views

How to draw a function like sin(x)~cos(x) in tikz/pgfplots?

In R it's easy to do something like x <- seq(0, 2*pi, 0.01) plot(sin(x), cos(3*x), type='line') to get the plot How can I make such a plot using tikz/pgfplots?
0
votes
0answers
24 views

Repeat beamer frames and R chunk

I'd set up a loop for multiple beamer frames and a R chunk within the loop too, but it always does work. The R chunk in the loop wasn't run by R. <<echo=F,results="asis">>= ...
1
vote
1answer
23 views

missing minus sign in R code using latex

I'm using lstlisting to include my R code in my LaTeX, however, the minus sign after < is not appearing in the compiled file. \usepackage{listings} \begin{document} \begin{lstlisting} ...
11
votes
1answer
54 views

How to incorporate a TEXMF tree managed by distro's package manager when using TeX Live from upstream on a GNU/Linux system?

I am using upstream's TeX Live on a GNU/Linux system with default paths except for the use of symbolic links to facilitate switching between different versions of TL. So, for example, TEXMFMAIN is ...
1
vote
1answer
45 views

Setting width of page

I would like to control the width of the document, i was able to set the margins more the the left (https://stuff.mit.edu/afs/sipb/project/www/latex/guide/node30.html) But that just moved the text to ...
2
votes
1answer
51 views

How to add packages in tikz using R

I wrote the following commands in R to generate a picture. However, the y-axis label is missing as the picture below shows. There seems to be some error in ylab="$\\ln \\mathbb V ...
6
votes
2answers
91 views

Three dimensional Regression Plan with Residuals

In R, I can make three dimensional Regression plane with residuals with the following command scatter3d(prestige ~ income + education, data=Duncan) with scatter3d function from car R package. I ...
1
vote
1answer
32 views

Lyx / Knitr - R Code in chunck goes beyond set width

I use Lyx (2.1.4) with knitr (1.10.5). I have a lot of trouble having the code chunks respect the width that I tried setting through various ways: In the chunk options (width=50); ...
0
votes
1answer
29 views

knitr example doesn't produce graphics

I tried compiling the given MWE for testing knitr: %% LyX 2.1.3 created this file. For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. ...
1
vote
1answer
20 views

How does knitr inject TeX code into the document?

I'm very new to knitr. How do I write R code in knitr that composes LaTeX from scratch and injects it into the document at a particular point? I'm thinking of something similar to what PHP or JSP ...
1
vote
1answer
54 views

Sweave-generated pdf-figure has two pages instead of one, with the first being empty

Using Sweave() in R I am trying to include a ggplot2-graphic generated by marrangeGrob() from the R package gridExtra into a pdf document. The problem occuring is that the pdf containing the figure ...
1
vote
1answer
47 views

Knitr pdf not working on Mac OS X error “! Missing $ inserted.”

I have the following chunk in rmarkdown {r } library(psych) a <- (matrix(c(1:1000), ncol=4)) f <- fa(a) But when I try to print inline the following output: `r f$null.chisq` I get the ...
0
votes
0answers
35 views

best way to capture R output into latex table

I am running a bunch of models in R using the caret package. This package is an interface to many modeling techniques and methodologies. There are certain output of each model I'd like to convert to ...
5
votes
1answer
297 views

New R Logo with Tikz

I want to make the following new R logo with tikz. My MWE with output is: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture}[] \node[blue] at (0,0) {R}; \draw ...
2
votes
0answers
47 views

Iterating through a character/string array in LaTeX

I have an array of strings, and am trying to output each element into LaTeX. I am able to achieve that using the following code: \documentclass[12pt,english,nohyper]{tufte-handout} ...
3
votes
0answers
90 views

Pgfplots Boxplots with a thick line at the mean value

pgfplot produces nice looking plots, that have consistent look and feel. But sometimes you have a good reason to change that look, and I found it tricky to change style of an specific line, circle, ...
1
vote
1answer
41 views

knitr: less/greater than sign displayed as (¡) and (¿)

I'm a beginner in using knitr to generate a report. I have a R script (see below for an example; BTW I'm using RStudio for all of this) that runs without error and the output is a data frame. My ...
1
vote
0answers
24 views

incorporating R code in latex, commentstyle not working

I have an issue with no all my R comments being colored in my latex file. I am using the listing package. My pre-amble code is \lstset{ % language=R, basicstyle=\footnotesize, ...
2
votes
2answers
72 views

Conditionally print text with inline R data via knitr

I want to conditionally print a sentence that contains a \Sexpr{} in knitr. How can this be done? I know I can conditionally print text using \Sexpr{} but I run into issues when the text to be printed ...
0
votes
0answers
33 views

Changing lisoffigures color in Rmarkdown

I'm using Rmarkdown with Rstudio to create PDF, and I add the option \listoffigures, but the font color of the links are pink. I tried to add some TeX option to change it like ...
1
vote
1answer
50 views

How to adjust float options of Tikz picture

I am trying to include several Tikz figures drawn in R, below eachother in a Latex file. It keeps including the figures at the top of new pages. Is there an easy way to make this work? The simple ...
1
vote
1answer
72 views

PDFLaTeX basic installation in windows for R pdf output for slow internet

I have a windows operating system. I'm using R statistical software. I have to output a R MarkDown file into pdf. This can be done by PDFTeX which requires installation from MiKTeX. R suggests that I ...
1
vote
0answers
61 views

Creating functions in Sweave

I have a Sweave .Rnw file in R. It does a few things across chunks: Chunk 1: Selects a random integer between 1:4 and saves as variable nPlots. Chunk 2: Writes nPlots (random integer selected ...
0
votes
1answer
41 views

Import tables into master latex file (like graphics).

I am working with R and Latex and using R to generate a series of tables that I am exporting as a unique latex script each (e.g. it exports the table formatted for latex in a new script). I would like ...
0
votes
0answers
14 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 ...
0
votes
0answers
43 views

Errors with untouched Beamer Template in RStudio

I am new to using Beamer, and wanted to have a template working so that I could, for the time being, simply and easily change the content. I downloaded the .zip file from ...
1
vote
0answers
116 views

Compiling .Rnw file into PDF in RStudio (Error: No file or directory)

I have a .Rnw file. I usually can "Compile" it into a PDF file in RStudio. However, I recently upgraded my R Version to 3.2.0. Now, when I try to "Compile" my .Rnw file I get an error: ...
2
votes
1answer
105 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 ...
0
votes
1answer
74 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
66 views

How to get the TexCalendarCompetition.Rnw build?

The TexCalendarCompetition.Rnw refers to Nicholas Hamilton's code contribution to the TUG calendar 2015 (see Nicholas' answer for details)
1
vote
0answers
38 views

Including graph using tikz causes not including bibliography file

I am experiencing problems using package tikz. I have produced a graph in R and want to include it in my tex file using package tikz. After I include the the tex file with graph in myfile.tex with ...
2
votes
1answer
74 views

how to combine different tex files to a single file and generate pdf using R

I have three data frames which I would like to put to pdf. I generate tex files for the three dataframes. So I have three tex files. I would like to combine it and generate pdf in R. Right now I use ...
1
vote
1answer
113 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
122 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
70 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

Latex in R getting error after putting code

I am getting this error in R ...after putting code for latex document Undefined control sequence Overfull\hbox(7.71355pt too wide) in paragraph at lines 16--16 Code is below ...
0
votes
0answers
58 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
49 views

Sweave's “fig=TRUE” cannot write file

I use Sweave to get my R data into LaTeX. While this works fine with "just data", I am not able to include plots. My .Rnw-file looks like this: \documentclass[a4paper,10pt]{article} ...
1
vote
1answer
64 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 ...
5
votes
0answers
114 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
195 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 ...
1
vote
1answer
72 views

Cropping an image generated in R code

I would like to crop an image that is not inserted (which has been searched a lot), but an image that is generated in R code. \documentclass{article} \setlength{\parindent}{0pt} ...
2
votes
1answer
102 views

Venn Diagram Automation tool

I would like to ask if there is a solution in any language that can help me create and maintain a venn diagram similar to the one below that I can insert in my latex text. I have already found some ...
2
votes
1answer
130 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
58 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 ...
0
votes
0answers
39 views

tikzDevice equivalent for SAS

tikzDevice is an interesting package capable of transforming graphical output from R to a LaTeX code. I used this package and I was satisfied. Does an equivalent for SAS exists. Thanks !
2
votes
3answers
163 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 ...
2
votes
1answer
367 views

What is the best way to include R code in the Latex paragraph

I am a newbie in Latex. I have two simple questions regarding including R code in Latex. Q1: For a block of R code, I use 'listings' package, as follows. \documentclass[12pt]{report} ...
1
vote
0answers
197 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) ...