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

KableExtra Memory Error. R-markdown [on hold]

I am getting an error message when trying to make 2 tables on the same page. ! TeX capacity exceeded, sorry [main memory size=3000000].@preamble ...e height@tempdima width\z@ \unhbox. Here is the ...
0
votes
0answers
8 views

Accessing variable in inline expression (rmd to pdf output)

I'm working on coding a reproducible rmd which will output a pdf document. I know that for an inline expression to work, it requires $ $ to be placed around it but is there a way around this? Client &...
1
vote
1answer
32 views

How to avoid the extension files when I compile pdf on r sweave

I face a problem when I compile pdf file I got many files in the working directory, for example, the files Untitled.tex and Untitled.toc along which my files Untitled.pdf and Untitled.Rnw. Can anyone ...
2
votes
1answer
40 views

Embedding R (kable) results in LaTeX

Apology at first if this question has been asked or the sample is not reproducible. I'm totally new to LaTex and happy to take any advice. I am working on my thesis on a .tex LaTex template given by ...
1
vote
1answer
38 views

Math symbol in Rmarkdown list

I am trying to get the following code to render correctly in rmarkdown, but unfortunately math mode does not seem to work in a list setting? Can anyone help with this? --- title: "Trial" author: "Jon"...
2
votes
2answers
35 views

How to make Manual references appear in bibliography (citing R)

I would like to cite R in my bibliography. However I'm having trouble getting it to appear. Here my mini.bib files contains @Book{, author = {Hadley Wickham}, title = {ggplot2: Elegant Graphics ...
2
votes
1answer
44 views

Manual bibliography in knitR with \bibitem{} works but cannot use \cite{} with it

I am trying to use a manual/embedded bibiography in a knitR/LaTeX document (long story short but for various reasons I don't want to be using a seperate .bib file because this script will be used many ...
2
votes
2answers
35 views

How to use \sexpr{} with variable that has “_” in it (i.e. avoid “math mode” error)

I am using knitr in R to write up a document in LaTex. Below a certain of code, I would like to refer to a variable I used in R. <<chunk>> var <- "ENSEMBL_MART_ENSEMBL" @ In this ...
1
vote
1answer
50 views

Can't remove italic format from my text with either \normalfont or \textnormal

$$\textit{Some italic and {\normalfont non italic} text}$$ $$\textit{Some italic and \textnormal{non italic} text}$$ My LaTeX block above is supposed to generate text like this (the first line): But ...
0
votes
0answers
182 views

Ubuntu 18.04 LTS Texlive 2018 ! LaTeX Error: File `ulem.sty' not found

After installing tinytex R package, I started getting LaTeX error regarding missing .sty files. One such error is LaTeX Error: File `ulem.sty' not found. I used the following code Checked Texlive ...
1
vote
1answer
44 views

Class tufte-book and R listings code box width problem

When I run the following MWE: \documentclass{tufte-book} \usepackage{Sweavel} \usepackage{amsthm} \usepackage{mathtools} \usepackage{soul} %%%%%%%%%% % R example %%%%%%%%%% \newtheoremstyle{rex}{}{...
0
votes
1answer
98 views

Disabling page numbering bottom of page

Newbie question here. I seem to have some trouble changing the page numbering. I want it in the header, instead of the bottom of the page. I got the header working, but I have been deleting and ...
3
votes
1answer
43 views

Tikz .tex file for a ggplot image made in R won't render as pdf in my tex document (but no compile error!)

I'll preface by saying that I'm not sure whether this is better off posted in StackOverflow, and I'd be happy to move it over there if that turns out to be the case. tl;dr I followed the ...
0
votes
0answers
140 views

Latex with rmarkdown (RStudio)

What must I do? This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit) entering extended mode Sorry, but C:\Users\Silvano\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex....
1
vote
2answers
47 views

Environment undefined ONLY when referencing a preamble.tex

I'm trying to use R Markdown to typeset some notes and I'm having difficulty using the \adjustwidth environment. The issue only arises when I reference some preamble.tex. For instance, if I have a ...
0
votes
0answers
20 views

Indexing terms being used in cross-referencing

This is a follow-up question of my previous one: Cross-referencing numeric values and text from later section to executive summary of a latex document I have finished making my report and now my boss ...
2
votes
1answer
104 views

How to add page numbers to inline references using csl in rmarkdown?

I am using RMarkdown in RStudio to reference multiple sources out of my .bib file with csl (see below). My .Rmd doc: --- title: "mytitle" author: "nunberg" date: '01\.01\.2019' output: ...
1
vote
1answer
44 views

How to cite german book titles properly (upper case) with csl and rmarkdown?

I am using RMarkdown in RStudio and want to cite several sources using csl, specifically I use the style "elsevier-with-titles.csl". I want to cite a german reference, so title must have upper case ...
0
votes
0answers
95 views

Having problems with LaTeX coding in Rmarkdown (fancyhdr, \headheight)

I'm currently having an issue with latex in Rmarkdown (using fancyhdr package). I am trying to make a data report with a certain template style. This is a screenshot of the pdf at its current stage ...
2
votes
1answer
114 views

How to center and flush right cells in a column

I am trying to create a table with a numeric column number which I wish to center and flushright content as follows: Using RMarkdown, I am only able to wrap LaTeX code around/inline with cell content ...
3
votes
2answers
369 views

Reporting R Results in LaTeX

I´m writing my thesis in LaTeX (using Overleaf) and I analyzed some data in R. So I have a R script where I perform a bunch of tests and regressions. Now I want to e.g. include the t-statistic and p-...
0
votes
3answers
418 views

Can I type \LaTeX inside inline code in Rmarkdown?

I know I can use $$ to write \LaTeX in Rmarkdown documents like $\beta$. My goal is if this is possible inside inline code. I would do `$\beta$` or `$\\beta$`, but both do not work. In case it is ...
1
vote
1answer
154 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
175 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
76 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
62 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
335 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
58 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
69 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
237 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
185 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
154 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
35 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
572 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
61 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
36 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
94 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
100 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
81 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
140 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
237 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
346 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
378 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 ...
4
votes
1answer
835 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
147 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
403 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
987 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
394 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
284 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/...