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

MikTeX won't let me install packages

I'm trying to learn how to use TeX within R. I've downloaded R, RStudio, and proTeXt. When I try to compile it, I receive a message that I am missing several packages; however, when I try to find a ...
1
vote
0answers
23 views

Trouble getting tikzDevice to work at all

Have used TikZ extensively over the years (MiKTeX is my LaTeX distro of choice), and recently, thought I'd try my hand at 'exporting' R graphics -> LaTeX used tikzDevice, which some folks have found ...
2
votes
1answer
28 views

Tables with reference to R objects in sweave / latex

I'm using knitr/R-sweave to produce a pdf-document wit LaTeX-code. I want to make a table with some numbers produced by some R calculations in the R-code-chuck above this table. When I usually want to ...
0
votes
0answers
18 views

What does “LaTeX Error: Environment rmdtip undefined.” mean?

I am trying to build a book using bookdown::render_book() command in RStudio. However, it stops working after the pandoc step almost at the end of the process: "K:/Program ...
1
vote
0answers
24 views

Produce multiple documents using a loop in LaTex

I want to produce multiple documents in LaTeX. There is a list of values for every document that should be created, in the example it´s \mylist. My first approach was to use the \foreach function to ...
2
votes
1answer
48 views

How to create a latex table in R with significance stars?

I have a latex table generated as following in R: \documentclass[12pt,econ]{authesis} \usepackage{natbib} % natbib citation style \usepackage{url} % added 2015-067-06 bc the example .bib ...
1
vote
1answer
30 views

\lstinputlisting with R problem

I'm trying to include my R code in a Lyx document but get the following error when trying to convert to PDF: \lstinputlisting{MonteCarlo.R} ^^M *** (cannot \read ...
1
vote
0answers
50 views

general footnotes in xtable

I am using sweave to create pdf. Using xtable, I am trying to insert a general footnotes under the table (i.e: This symbol means bla bla bla). I've tried a lot of things and everything get me an error ...
1
vote
1answer
50 views

make the TeX xtable results well formatted and easier to read

Is there a way to make the TeX xtable source code results well formatted and easier to read. Example: library(xtable) ## Load example dataset data(tli) print(tli.table) gives \begin{table}[ht] ...
0
votes
0answers
16 views

mtable into LaTeX: ! Missing } inserted.<inserted text>}

I am trying to write my thesis with LaTeX (first time using it) and I am struggling with making some tables. I am using toLatex in R to produce an mtable, which gives me the following code: ...
2
votes
1answer
18 views

Set TeXstudio for Unicode .Rnw files (Sweave)

I tried to run Sweave on a .Rnw file from TeXstudio, but the unicode characters don't show up in the .tex file when I typeset with xelatex. My user command is /usr/local/bin/Rscript -e ...
2
votes
1answer
91 views

2D correlation plot matrix with shapes

Is there a straightforward way to create a correlation plot matrix similar to the figure below? The image is an example of R's corrplot package using circles, which also offers other shapes and ...
0
votes
0answers
37 views

How to create an index for a book that includes code chunks

I'm in the process of creating an index for a book that includes R code chunks. I'd like to include certain R functions that appear in these chunks in the index, so I assume I have to place the \index ...
0
votes
0answers
26 views

dplyr Tables latex problem

Can you explain why the caption of the table is not appearing in the example below. All works fine except the caption \begin{center} <<echo = FALSE>>= library(dplyr) myTable <- ...
2
votes
1answer
64 views

siunitx: What is the correct way to output mean and standard deviation as “M (SD)” in an S-column?

I am trying to use siunitx in a psychology results table to line up decimals, and the table looks like this: \documentclass[]{article} \begin{document} \begin{table}[h] \begin{tabular}{@{}cc@{}} ...
4
votes
3answers
111 views

How to extract a series of text not in an environment, but with defined commands enclosing them

Under Windows 8, I am using R and the knitr package in RStudio with an .Rnw script. My regex skills are passable, but only in R. My document has about thirty pages with a different text section at ...
0
votes
0answers
73 views

Writing R code in TeXstudio

I have one chapter of my document which include R code. Whole document is written in TeXstudio. I need help regarding writing and executing R code using Texstudio. Regards
1
vote
2answers
76 views

How to avoid page break after table?

I have a small LaTeX table (tabular) created in R with the xtable package and I would like to place a figure underneath the table on the SAME page. I have tried various things (using packages float, ...
1
vote
1answer
47 views

Following .Rnw works fine in RStudio but throws error in LyX

This .Rnw compiles fine in RStudio Version 0.99.862 \documentclass{book} \usepackage{Rd} % Rstudio will be able to find this .sty file \begin{document} <<label=Test, echo=FALSE, ...
1
vote
1answer
116 views

How to align multiple equation using tcolorbox in latex enviroment for Rmarkdown

I have the following latex inside Rmarkdown: \begin{tcolorbox} \begin{equation} \sigma = \beta_{0} \label{eq:Model0} \end ...
1
vote
1answer
68 views

Including TikZ picture in Sweave gets me an overfull box error

I have some difficulties in R Sweave so I hope someone could help me. I want to include two TikZ pictures using minipage and figure to the R Sweave but I get an error: Overfull \hbox (2.43085pt too ...
1
vote
2answers
65 views

Where set font in tikzDevice-plots (.Rnw)

I'm trying to use sans serif fonts for the text in plots (ggplot2) made by R, within KOMA-book. Unfortunately I'm not very experienced in managing fonts and their families. To keep things consistent, ...
1
vote
1answer
206 views

Sweave R code chunk default colors in vignette

Typically, if I create a .Rnw file and add R code chunks to it, and then convert it to .pdf file, the R code text will have default color and font than the rest of the document text. An example ...
21
votes
3answers
728 views

Literate R Programming

I'd like to embed some R into a LaTeX document. After a bit of googling I found that Sweave and knitr allow you to do this. I compiled a simple example with Sweave and it works. I'd be much obliged ...
1
vote
0answers
358 views

align, aligned and R Markdown

I have been working in R Markdown, which supports LaTeX, including in display mode. I had the following snippet for displaying aligned equations $$ \begin{align} a_1 &= \beta_0 \\ b_1 &= ...
3
votes
1answer
49 views

Conditional evaluation of Sweave chunk

I'm using some R code to import and manipulate a time series. The code takes some minutes to run and, as a result, it generates a relatively small time series. Now, to prevent typesetting to take an ...
2
votes
1answer
56 views

Insert line break into knitr fig.cap?

I am using knitr and want to insert a line break in my fig.cap chunk option. Is this possible? The following is all I can think of but it doesn't work. I expect there's some evaluation option but I ...
3
votes
2answers
282 views

Using LaTeX font in R (Computer Modern)

I am looking for at way to plot graphs in R, using LaTeX fonts. In the documentation for pdfFonts in R, it states that: There are also mappings for "ComputerModern", "ComputerModernItalic" and, ...
2
votes
0answers
47 views

What is the counterpart in LaTeX for the R package ezknitr and its tools for managing paths and directories

Dean Attali has just added an R package called ezknitr to CRAN. It enables those who use knitr and RMarkdown in .Rmd files to handle directories quite flexibly. His blog describes it well: path ...
2
votes
0answers
24 views

Graphics prepared with Sweave and text disorder

I am preparing a report using Sweave, it is really beautiful, but the first introductory words of my pdf-file appear after the first R-plot! How to fix it? I would like to add that I've already tried ...
1
vote
0answers
570 views

Error 43 while knitting a markdown to pdf in a R project created on mac and run on Windows

I created a R project which outputs some plots to pdf using rmarkdown::render with an .Rmd file. I shared the folder when the R project and all the relative files are kept to a colleague using Google ...
0
votes
1answer
174 views

Error in compiling LaTeX (bmcart.cls not found)

I'm a complete beginner to LaTeX. I want to try a latex template, so I: Created a new R Sweave file in RStudio Copied and pasted the source in ...
2
votes
2answers
78 views

With knitr and LaTex, how can you arrange the List of Figures alphabetically?

What code will enable me to reorganize the List of Figures alphabetically (and keep the page number)? My goal is to include that alphabetical listing of figures in the PDF file that is created. Here ...
2
votes
0answers
48 views

Knitr Plot Tooltips for ADA Compliance

I would like to use Knitr to generate plots in R that have hover-over tooltips. Here is a working example without an R tooltip: \documentclass{article} \usepackage{pdfcomment} ...
0
votes
0answers
29 views

How can I have the Latex structure in knitr?

how can I have the same structure, I mean: \section, \subsection, ... in knitr or Markdown? Is there any possibility to include every section in a separate file like in latex? ...
2
votes
0answers
83 views

Extra Curly Braces when creating Xtable using Knitr, after specifiying size

I'm creating a R Markdown document using knitr and am running into trouble using xtable to create a table. My table is very large and I'm trying to reduce the size using the size command in the print ...
8
votes
2answers
219 views

Encrypt and decrypt parts of text in a LaTeX source file

Assume that you have some text in parts of your LaTeX document that you only want people with a password to see. A reason could e.g. be a case with an guiding answer. You want to make the case public ...
1
vote
0answers
52 views

tikzDevice in R, set absolutlely all fonts, fontsizes and fontweights to TeX document fontsize

I am learning R, and I want to use tikz to inlcude R plots in my documents. However, to me, half the point is that I want to set absolutely all typefaces, fontsizes, fontweights to the TeX-document ...
2
votes
1answer
39 views

Setting up winefish to compile sweave

The winefish latex editor has a "texbox" field in the preferences window, which tells it how to do various things, like PDFlatex for example. There is something about regular expressions, a command ...
0
votes
0answers
67 views

Knitr not available in LyX (Windows)

I installed LyX with MicTeX on my pc. I installed the Knitr module. So I see in the packages in R studio that I can add 'Knitr'. After that i added the path of R.home('bin') to the PATH in the ...
2
votes
2answers
180 views

Running R code from latex. (alternative to knitr)

If you want to export the output of an R script to latex and create a pdf document you can use the package Knitr with RStudio. But I guess this is only a good practise for short results. What if I ...
2
votes
2answers
157 views

Citations in tabular environment not working

I'm writing my thesis with Rmarkdown but with a lot of LaTeX mixed in. When I compile the document, all my citations appear just fine, but those in my table appear as [?]. I have tested different ...
1
vote
0answers
68 views

R, Metafor package and Latex output

I have a problem in exporting output produced in R using the metafor package to latex. The object I'm trying to export are few rma and rma.mv outputs. As example, I'll post some output of the rma ...
0
votes
0answers
132 views

How can I set formatting options for an .Rmd outputting to .pdf

I have a .rmd in r studio. This is being compiled by the r package knitr into a pdf via the pdfLaTeX engine. DISCLAIMER: I am very new to LaTeX, and have been searching for days without luck on how ...
3
votes
2answers
246 views

points of R plot (saved to pdf) are not showing up with pdflatex

I am generating a pdf plot with R: library("ROCR") p <- c(0.226809355461365, 0.230331183191861, 0.245193329547248, 0.230982114615013, 0.231497802927267, 0.2296662312173, 0.224856867748048, ...
0
votes
0answers
356 views

Encoding error when knitr -> LaTeX -> PDF

I have a document written in knitr. I can export it to HTML and docx, but not PDF for some reason. The Rmd file is here http://cl.ly/dJka?_ga=1.30252732.2076817589.1442770201 It says ! Package ...
0
votes
0answers
68 views

R to LaTeX with knitr and pandoc (error in a guide)

I want to follow the guide http://kieranhealy.org/blog/archives/2014/01/23/plain-text/ since my document http://rpubs.com/lindberg/110268 need to be pushed to latex for a better read. The tex says ...
0
votes
0answers
65 views

How to create tikz figures via knitr forcing labels featuring LaTeX's font size modifier-commands?

Is there a way to force knitr to create tikz code which includes font size information? The output would be something like this: \begin{tikzpicture}[every node/.style={font=\footnotesize}] Here is ...
1
vote
0answers
130 views

ShareLatex knitr install package

Sharelatex comes with a few R library's that you can query. However, it is impossible for me to install a package or query a non pre-installed package. The package I am trying to use is the arm ...
1
vote
1answer
130 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 ...