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.

Filter by
Sorted by
Tagged with
0
votes
1answer
42 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
113 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
38 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
128 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
104 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-...
8
votes
1answer
153 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
270 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
418 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
561 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 ...
6
votes
1answer
1k 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
181 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 ...
2
votes
1answer
451 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
1k 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
489 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
348 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/...
3
votes
1answer
1k 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
189 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
2k 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 ...
3
votes
1answer
182 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
256 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
365 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
1k 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
4k 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
2k 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 ...
3
votes
1answer
2k 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
3answers
5k 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} ...
1
vote
1answer
3k 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
260 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 ...
4
votes
3answers
2k 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
454 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
971 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
799 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
405 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 ...
8
votes
1answer
763 views

colour R code to match knitr theme using listings, minted, or other

with the listings package, and the help of this answer and this answer, I can include R code in my LaTeX document that looks almost like what knitr produces natively. However, as I am combining a ...
1
vote
2answers
253 views

Passing a string into Sweave Rnw file

I understand from this question that it's possible to push a variable to an Rnw file from the R script that calls it by storing that variable in the global environment within the R script. I've tried ...
0
votes
1answer
151 views

Decreasing the size of a plot

Hi there so I have this plot in knitr in R, which i want to transfer to my Latex PDF file, but it's just way too big it fills up like 3/4 of a page: compPlot ( mdata$GDP, fitted( cesNewton), xlab = "...
1
vote
1answer
274 views

Using knitr and Latex problem

So I am currently doing a CES function estimation using the micEconCES package in R. I want to incorporate the outputs of the estimation into my latex file, but I cant seem to get it to work. This is ...
2
votes
1answer
922 views

Including multiple images with single caption

I'm trying to insert side-by-side images with one caption using knitr: --- title: "XY" author: "Doogan" date: '`r format(Sys.Date(), "%B %d, %Y")`' graphics: yes output: pdf_document: toc: no ...
2
votes
2answers
647 views

Using LuaLaTeX and knitr together

I would like to include R results in a LuaLaTeX document, which I prefer over XeLaTeX mainly because of the greater support of the package microtype. Do you know whether and how is it possible? ...
2
votes
1answer
890 views

Excessive blank space after a graphic using R and kntir

The problem is the following: I want to have the text from section 6 way closer to the graphics. This is the code I am using: \documentclass{article} \usepackage{graphicx} \usepackage{microtype} \...
0
votes
1answer
562 views

How to replace a string in \Sexpr by a variable

I am using latex to automate reports. In R, I create a data frame that contains all of the metrics and then using \Sexpr I filter that data frame for a specific metric. Currently, I have this: \...
1
vote
0answers
100 views

passing string from R to href in rnw file

I would like to pass a string from R script in order to run href in my rnw file. In the R script I have to include double \\ for the href otherwise I get error. ifelse(is.na(url_ui_1)|is.null(...
0
votes
0answers
54 views

\isdefempty not working for multiple macros

I am still learning tex. The following example allows me to check if a variable exists, and if it does then prints some text in the PDF. This works great. However, when I add in a href, this appears ...
0
votes
1answer
2k views

pdflatex from MikTex not working inside windows

I am trying to compile some tex files into pdf files using pdflatex but it is not working. Can anyone spot what the problem is? I appreciate any kind of help. I was first trying using R but it seems ...
3
votes
2answers
1k views

How do I add multiple conditions to \ifthenelse?

Thank you in advance for any help. How do I add multiple conditions to \ifthenelse? I want to be able to write: \ifthenelse{varType equals 'HS' and metric equals 'KPI1'} {do this} \ifthenelse{...
0
votes
1answer
3k views

Looping through data frame and adding each value in column to PDF

Please bare with me as im UBBER new to creating pdfs in R Studio. My R code grabs a bunch of files from an ftp site and for each of these files I loop through and create a pdf...all this works great. ...
1
vote
1answer
44 views

Why ~ is not shown in place in R source listings? [duplicate]

My sample code is- \documentclass{article} \usepackage{listings} \usepackage{xcolor} \begin{document} \lstinputlisting[numbers=left,backgroundcolor=\color{lightgray},language=R]{code.R} \end{document}...
2
votes
1answer
396 views

Can’t yet set up knitr with TeXShop

I want to use knitr with TeXShop. So far I can’t get knitr and TeXShop to talk. I’m not sure how to make a reproducible example nor how to make the following succinct, but here’s what I’ve tried: ...
0
votes
1answer
153 views

Formatting R arrays in LaTeX Beamer

I have an R array output that I would like to include in a LaTeX beamer slide. The array is simple enough , , 1 [,1] [,2] [,3] [,4] [,5] [1,] NA NA NA NA NA [2,] NA NA NA ...
3
votes
1answer
18k views

pdflatex not found (windows)

I am trying to exporty a pdf file from the R output using R markdown. I donwnloaded the MikTex, but when I tried to run the R markdown, it showed this error message: pandoc.exe: pdflatex not found. ...