Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [r]

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.

1
vote
1answer
32 views

Importing entire R Script file into Latex

Is there a way to import an entire RScript (.R) file into Latex directly without manually using listings and copying the code into Latex?
0
votes
1answer
57 views

R Markdown preview LaTeX by scrolling over

I believe in the past I have been able to preview my LaTeX code in R Markdown by just placing the cursor over the LaTeX chunk, but right now I'm unable to recreate that. Any idea how to turn that back ...
0
votes
1answer
33 views

Table of contents in Beamer R Studio

i'am trying to generate an beamer presentation but i can't add an Ouline of my document: this is my code: --- title: 'PEC-3 Gestión Económico-Financiera: Casos de Negocio. El sector de la ...
0
votes
2answers
39 views

side by side tables latex - without \floatrow

I have the following simplified document (): \documentclass[10pt]{book} \usepackage{float} \let\origfigure\figure \let\endorigfigure\endfigure \renewenvironment{figure}[1][2] { \expandafter\...
0
votes
1answer
118 views

How to write y i = β 0 + β 1 x i + β 2 x 2 i + e i in Latex code? [duplicate]

I'm a beginner of using R and Latex. Just wonder how to write yi = β0 + β1xi + β2x2i + ei by using Latex?
0
votes
1answer
30 views

How to use if-else statements in sweave documents

Is there a way to use an if-else statement in an sweave document, so that a figure is only shown depending on the value of an R object. I tried different approaches (two of them are below), but I did ...
0
votes
0answers
41 views

Converting Tab-delimited reference list into a bibtex format (using R?)

I need to export search results from Web of Science (i.e. all the results of a query, 100s of entries) and import them in Mendeley with their abstract. while I usually can export a citation in a .bib ...
0
votes
1answer
108 views

mathbb not working and mathbbm/mathds not compiling in rmarkdown [closed]

I'm trying to get the math 1 character in an rmarkdown file. \mathbb{1} just produces a simple 1, and \mathbbm{1} / \mathds{1} does not compile for some reason. title: "A3" header-includes: - \...
2
votes
1answer
96 views

Getting R xtable to display within a LaTex 'minipage'

I have the following piece of R-markdown / latex / minipage combo code. What I am trying to do is get the xtable output to display within the minipage, along with other text paragraphs surrounding it....
2
votes
1answer
70 views

Caption in Sweave after an R plot

I have the following R chunk: <<echo=FALSE>>= par(mfrow=c(3,1)) #cas basal: no negra no fumadora sense prematurs ni hipertensi? lwt.pred<-seq(80,250,1) prob.pred<-0+model.final$...
0
votes
1answer
32 views

How to set roman font to make references to R? [duplicate]

I'm writing a thesis and I need to make references to R. I've read some other articles that cite "R" and they seem to use the roman font. I have no idea how to set this font :(
1
vote
1answer
286 views

Undefined control sequence in R markdown

I have got stuck on this code which I could not be able to find that in my content anymore after checking for more than two times. Is there any packages I should have updated? As I am using TexShop ...
0
votes
1answer
30 views

Tikzdevice with ggplot: overfull hbox

I have the following R code to generate a tikzdevice plot: tikz(file = "plot_CIs.tex", width = 5, height = 5) par(cex = 0.8) ggplot(confidence_interval, aes(x = Statistic, y = Values, group = 1)) + ...
0
votes
1answer
23 views

Sweave child rnw losing formatting

I have managed to get a master.rnw include a child.rnw, however, I can maintain the formatting of the child document based on the preamble in the master. Master.Rnw \documentclass[11pt,a4paper, ...
2
votes
1answer
71 views

How to avoid problems with diacritics once and for all

I work with Rnw, and I type in Catalan, so there are diacritics I wouldn't encounter in English. I just want two things: That when I compile my PDF, all diacritic letters are as they should be. That ...
0
votes
1answer
33 views

creating multiple generic letters from pulling info from an excel/csv file

I wanted to create 100 invitation letters for a group of 100 people whose name and phone number I have in an excel sheet. I have written one generic letter and wanted to the put in the name and phone ...
1
vote
0answers
52 views

Problem with out of KableExtra tables with LATEX in Rstudio: paste0 function

This is my Rsweave reproducible example: \documentclass{article} \DeclareUnicodeCharacter{3B1}{$\alpha$} \DeclareUnicodeCharacter{3C4}{$\tau$} \DeclareUnicodeCharacter{3C3}{$\sigma$} \...
0
votes
2answers
53 views

Making TeXLive Bera Font Accessible on MacOS/R/etc

I used to be able to create R graphs with texlive's bera .pfb font on macos. Alas, somewhere along the line, it stopped working. (I am asking in https://stackoverflow.com/questions/53089029/using-...
7
votes
1answer
128 views

How can I use Context and R together?

I am using conTeXt to create pdfs (I need to use Context rather than any other latex engine because I am using their tagging feature to create pdfs with tagged document trees). I would like to be ...
0
votes
1answer
142 views

Array command in Latex

I wonder may I ask about why I received the error note from R-Markdown that ! LaTeX Error: \begin{array} on input line 569 ended by \end{equation*}. #1, Let X = \[ \left(\begin{array}{cc} 1 &...
0
votes
1answer
225 views

Loading Custom Fonts into RMarkdown

I've been testing loading my own fonts into a personal rmarkdown document using the fontspec latex package. Because I'll eventually need to knit this on a server, using the font library on my mac is ...
0
votes
1answer
195 views

Return to regular alignment after centering equations in R markdown

the text in R markdown is below. I am trying to export to a pdf. Another benefit of the multi-level model is its hierarchical structure. In this case, most games against opposing teams are played in ...
3
votes
1answer
460 views

Using biblatex with R Markdown

I am trying to compile a PDF Output with an R Markdown file and build my bibliography with the biblatex package and using R Studio. Here are my code/files in index.Rmd --- title: | Hello World! ...
3
votes
0answers
105 views

Including an Rmd file in a Rnw file using pandoc

I was trying to follow this example that shows how to write a separate chapter in RMarkdown and then include it in your main RNW file using \include{}. However, I have not been able to get pandoc to ...
0
votes
0answers
75 views

I get an error every time I try to run my Latex document in Texmaker, using a chunk code from R

I'm following the following guide: https://joshldavis.com/2014/04/12/beginners-tutorial-for-knitr/ I've installed the knitr package and run it in R, and I'm trying to copy and paste the example from ...
2
votes
1answer
313 views

Option clash with RMarkdown and beamer

I work across two separate Mac computers, a Macbook Pro at work, and a Macbook Air at home. Both macs are running identical operating systems. I am writing in RMarkdown, using knitr to compile beamer ...
1
vote
1answer
725 views

Line spacing 18 pt in r markdown [duplicate]

Iam writing my thesis in r markdown and want to change the line spacing to 18 pt. But i cant find a solution for it. I only found the setting for onehalf spacing or 1.5 spacing but no for exactly some ...
2
votes
1answer
255 views

i trema doesn't appear in RMarkdown LaTeX document

I'm trying to write about naïve modeling, and have written the following header: ## Na\"{i}ve Modeling That, however, and all variations like it, produce only something that looks like this: Na"{...
1
vote
1answer
162 views

R code (ggplot) not outputting to .tex file

I'm relatively new to this so possibly a duplicate question but I am trying to use library tikzDevice to add a ggplot figure to a LaTeX document as per this guidance: http://iltabiai.github.io/tips/...
2
votes
1answer
738 views

Can TinyTeX replace MiKTeX or TeX Live

On Windows I use MiKTeX and TeXstudio. On Linux I use TeX Live and TeXstudio. I don't write much in LaTeX. I write a lot in R Markdown. R Markdown output to pdf works best (for me) with TinyTeX LaTeX ...
2
votes
1answer
141 views

Output from for loop in LaTeX table

I have a for loop in an R file and I need the output of for loop to be stored in a table for LaTeX. I know about the table package, but I can't figure it out. My code goes as follows: for(i in seq(...
1
vote
0answers
1k views

R Markdown and Latex: Change font family and size for table of contents

I am trying to create an automated report in rmarkdown for business partners and I am a bit stuck on how to alter the table of contents. Essentially, I would like the table of contents to have a ...
-1
votes
0answers
109 views

Table with brackets from Stargazer

Is it possible to make a table that has brackets bracketing multiple rows in a table from within the Stargazer environment?
3
votes
1answer
87 views

Plot symbols not showing properly using R + knitr with 'pdf' device

When I include R plots in a latex document using knitr, symbols do not show properly when knitr's graphic device is 'pdf', while everything is OK when the graphic device is 'png'. Here is a MWE: \...
0
votes
0answers
185 views

Centering the figure caption when switching page orientation

I'm a newcomer to Latex but I've already found it very useful. I have a document that requires me to switch the orientation from portrait to landscape midway through the document so I can properly fit ...
2
votes
2answers
243 views

Automatic bibliography by DOI

I would like to know if it is possible in LaTeX to automatise the bibliography. For example, I would only put the DOI link in the bibliography and latex would take all the info (author, date, title ...
1
vote
1answer
617 views

How to get LaTeX math into Legend of R plot

I'm trying to add a latex math expression to the legend and labels of a chart made in R but haven't found any examples where this has worked. For example, my y-axis label should be like "Availability,...
0
votes
1answer
2k views

How to reduce intercolumn space with stargazer

I have been navigating around for some time, trying to find the answer to my problem. I have made a few regression in R and want to export them with the stargazer package into LaTeX. However, ...
3
votes
2answers
1k views

Left Quotation Marks when using RMarkdown and knitR

Normally when you want left quotation marks in LaTeX, you type the following: `` However, in RMarkdown, you will trigger a block of R code to run when you type two pairs of backticks on the same ...
2
votes
1answer
1k views

How to make cross-references to sections/figures before they are introduced in R Markdown?

I'm using Rmarkdown and Bookdown to write an article. The issue I'm running into is with cross references and the order of introducing them and referring to them. For example, in this paper example, ...
2
votes
1answer
2k views

pdflatex problem with Rstudio

I'm trying to compile a simple Rnw file in Rstudio using knitr "compile pdf" functionality. But it gives me an error. This is what I have in hello.Rnw: \documentclass{article} \begin{document} ...
0
votes
0answers
225 views

R code in LaTeX in YAML before_body include

I have a LaTeX section that I put at the top of my knitr generated PDF document. I achieved this by using the YAML options output: pdf_document: includes: before_body: file....
1
vote
1answer
2k views

Minimal LaTeX install for knitr to export PDFs from Rmarkdown on Debian-based system

I use RStudio and started writing Rmarkdown documents to knit them into HTML pages and PDFs. I tried installing TexLive but it failed when the astounding number of packages filled my limited ...
1
vote
1answer
162 views

Cite R packages without direct citation, in beamer

I would like to cite R packages we did for a group work, without direct citation, in my beamer presentation: I would like to have a final frame (or group of frames) that recap all the packages used. R ...
3
votes
3answers
1k views

Help with long table from Stargazer

I have a table made in R with Stargazer however, it is too big to fit a page in LyX. I have tried to use \longtable but it doesn't seem to work (might be doing it wrong). Here is the original code \...
0
votes
1answer
303 views

Horizontal alignment of 3 elements in footer of a PDF output from RMarkdown using LaTex

How do I fix the horizontal alignment of my footer in a PDF file produced from an R Markdown using LaTex? Here's my header.tex file: \usepackage{graphicx} \usepackage{fancyhdr} \fancyhf{} \...
0
votes
0answers
161 views

Unable to get Rmarkdown + biblatex to give maxcitenames to work properly to yield et al after first author

EDITED: If the answer from this post worked, I would not need help, since this is my exact question. I would like to have the in-line citations give (FirstAuthor et al., XXXX) and I am using Rmarkdown ...
0
votes
0answers
740 views

RStudio - File not found error, but file exists

I just completed installing MiKTeX 2.9 on my work laptop so that I can using it with RStudio v1.0.153. I'm run just the default R Notebook file that you get when you select New >> R Notebook. After I ...
1
vote
1answer
513 views

execute R code in latex file imported from separate R file

My personal objective in this Rnotebook revolution where typesetting and number crunching cohabitate is to keep R files separate from latex and as little polluted by markdown as possible and only in ...
0
votes
1answer
330 views

Sublime Text 3, LaTeXing, and R

I have been using Sublime Text 3 in conjunction with the LaTeXing and R-Box packages to write/compile .Rnw files. Everything was working fine until I updated to a newer version of R (3.4.3). I have ...