Skip to main content

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
1 answer
26 views

LaTeX not rendering in RMarkdown after update

As a non-speaker of LaTeX, I frequently use RStudio's markdown editor to do what little LaTeX-y things I need to. One of these things was my CV, for which I used this template. Much to my dismay, ...
Justin 's user avatar
0 votes
0 answers
17 views

latex not finding graphics in wd. using RStudio and r sweave

\documentclass{article} \usepackage[pdftex]{graphicx} \graphicspath{{"path to directory"}} \begin{document} \begin{figure}[p] \includegraphics[width=\linewidth,height=0.9\textwidth]{{&...
Groggy's user avatar
  • 1
0 votes
1 answer
42 views

LaTeX rendering in source mode but can't knit pdf

I am getting an error with LaTeX saying "You may need to add $ $ around a certain inline expression". The text renders correctly when I look at it in the source mode but I can't knit it. I ...
user24903005's user avatar
1 vote
0 answers
16 views

Reverse numerical list using Rmarkdown rendered to PDF with LaTex template

I would like to list my publications in reverse order on my CV, which I am generating using Rmarkdown and a LaTex template. In my searching I found the etaremune package but cannot figure out how to ...
selene's user avatar
  • 111
2 votes
1 answer
33 views

Set global options for all R code chunks and plots throughout LaTeX document

Making a couple of R plots in my LaTeX document on Overleaf. Every R plot is being placed inside of a figure environment: \begin{figure}[h] \centering <<>>= curve(dnorm(x)) @ \caption{...
BeBlunt's user avatar
  • 25
1 vote
0 answers
54 views

TeXLive 2024 error when building R-4.3.3

TeXLive2024 downloaded from the 'Net is installed on my Slackware64-15.0 laptop. When building R-4.3.3 it fails toward the end when trying to build a vignette: * DONE (mgcv) make[2]: Leaving directory ...
Rich Shepard's user avatar
0 votes
1 answer
16 views

Knitting R rmd to pdf Error

I am stuck on a problem on knitting R, this is the error code that i got: This is pdfTeX, Version 3.141592653-2.6-1.40.26 (TeX Live 2024) (preloaded format=pdflatex 2024.4.4) 4 APR 2024 22:30 ...
HIken's user avatar
  • 1
0 votes
1 answer
26 views

How to output text in ukrainian language in r markdown

I want to write book and I need outputing text ib ukrainian language (forma pdf). I dont understand how to do it. I tryed using "babel" but it didnt work.
Александр Минаев's user avatar
0 votes
0 answers
88 views

Alter the position of barcode in \begin{pspicture} within a rmarkdown document

I'm trying to alter the position of a barcode in a document, but so far I have found nothing... This is my Rmd file (with the YAML header between these two ---)... --- geometry: paperheight = 8cm, ...
tueftla's user avatar
  • 175
4 votes
3 answers
231 views

Barcode output in rmarkdown document

I want to have a barcode like given in this answer Can't generate code128 barcode There also stands that it doesn't work with pdflatex engine - it has to be changed to the xelatex engine and that's ...
tueftla's user avatar
  • 175
0 votes
1 answer
39 views

How to enter symbols and align equations [closed]

1)I wrote an equation and when I hover my mouse over it it shows perfectly as I want it to but when I am knitting to pdf I get the error 1 : Code used for error1: $var(u_{t}) = {\delta}_{u}^2 < \...
Rick The Sizzler's user avatar
0 votes
1 answer
73 views

Inserting R code chunks in Rmarkdown making an error

My little demo code borrows from here is given as follows (test.rmd): --- documentclass: article output: pdf_document: number_sections: yes keep_tex: no geometry: "left = 2.5cm, right = ...
John Stone's user avatar
1 vote
2 answers
225 views

TinyTex from RStudio Rmarkdown knitting to pdf. "Approximately" sign in ggplot annotate throws error

Reproducible example: require(ggplot2) myggplot <- ggplot(data.frame(x=1:2, y=1:2), aes(x=x,y=y)) + geom_point() z <- 16.9 myggplot <- myggplot + annotate(geom="text", x= 1.5, ...
Reader 123's user avatar
2 votes
1 answer
62 views

How to use Sweave (knitr) with LuaLaTex?

This is a duplicate of this 5 year old question, because the answers there don't work (for me). Has someone managed to get knitr for Sweave documents (not RMarkdown) running with LuaLaTex as an engine?...
abeeisnotabug's user avatar
2 votes
0 answers
272 views

Best way to create a table for data in R?

Main question: What is the best way to create a table in a LaTeX document for data from R? At first glance, two possibilities seem conceivable: Let R create the table and "paste" it into ...
user1's user avatar
  • 2,216
1 vote
2 answers
63 views

How to solve in RMarkdown pdf error related with complex centered subtitle

I am working with RMardown and I am trying to add a centred subtitle containg model syntax that I am going to show at that section --- title: "example" author: "X" date: "2023-...
12666727b9's user avatar
3 votes
1 answer
372 views

Using LaTeX with TikZDevice in R: is it possible to set the font for Tikzfigures to 10 while 12 for the text?

I use R and ggplot to create figures, which I then import as tikz code into my LaTeX file. The publisher wants me to submit in their template, which is based on [12pt]{article}. However, whenever I ...
canIchangethis's user avatar
0 votes
2 answers
227 views

Backrefs not working when creating a pdf using bookdown/latex

I'm writing a latex/PDF book with R/bookdown. I'm trying to include, in the bibliography, a list of the pages that each article was cited in (i.e., backrefs). However, the backref and pagebackref ...
itpetersen's user avatar
0 votes
0 answers
38 views

How to correct !Undefined control sequence error created by \definecolor? [duplicate]

I'm trying to create a pdf table generated in latex format in R, but any of the commands below generates and !Undefined control sequence error. I tried removing this line or putting it below the \...
je2018's user avatar
  • 1
0 votes
1 answer
943 views

unable to compile quarto document using kableextra and table caption

I have been trying out Quarto as a replacement for RMarkdown for writing reports but come across some problems with tables. The main issue seems to be that I cannot get it to compile if I am trying to ...
Ollie's user avatar
  • 3
0 votes
0 answers
33 views

! LaTeX Error: File `polyglossia.sty' not found [duplicate]

I get error as "! LaTeX Error: File `polyglossia.sty' not found. ! Emergency stop. <read *> Error: LaTeX failed to compile ase.tex. See https://yihui.org/tinytex/r/#debugging for ...
Rasim Dilbani's user avatar
1 vote
1 answer
137 views

Syntax highlighting doesn't work after percent symbol %

I'm trying to highlight my R code using minted package. However, after %, a few lines didn't get highlighted. When I delete % problem disappears. My code: \documentclass{article} \usepackage{minted} \...
Sawyer Shu's user avatar
2 votes
0 answers
95 views

writing tables from r to latex without changing decimal format

I have ran a set regression in r and collected some of the statistics in a data frame format: variable|coefficient|s.e.|p-val|control|....| I am now writing that table using a template on my desktop ...
another_bik's user avatar
1 vote
0 answers
68 views

Compiling error with R plots

I appreciate your advice in advance. The following code worked around two years ago and it stopped working after I updated TexLive, and R to the latest version. The error message is Paragraph ended ...
user3084501's user avatar
0 votes
0 answers
311 views

Merge columns with similar rows from another table (from stargazer in r)

I have two descriptive statistics tables created through the stargazer package in R. Table 1: \documentclass{article} \begin{document} % Table created by stargazer v.5.2.3 by Marek Hlavac, Social ...
Shunrei's user avatar
0 votes
0 answers
191 views

Undefined control sequence for \NormalTok or \SpecialCharTok

I am using a template to write my thesis (https://github.com/ryanpeek/aggiedown) in latex. I have everything installed however, when I run bookdown (bookdown::render_book('index.Rmd', aggiedown::...
Noah_Seagull's user avatar
1 vote
1 answer
117 views

Control table height

I'm trying to create a table with mailing adresses to print so what I need is to match my table dimensions to the pre-cut sticker paper. So far I've managed to control column width with p{\dimexpr 0....
wernor's user avatar
  • 113
1 vote
0 answers
932 views

Add R code to Latex document

I have a small amount of code I wrote in RStudio that my supervisors want me to include. Does anyone have any recommendations on how to include R code as part of a larger Latex document?
user366566's user avatar
1 vote
0 answers
67 views

R equivalent for tikzDevice but for pstricks?

I use R for producing some graphics (with R base). Thereafter to better adjust the R graphics to use in LaTex I export the R plots with the tikzDevice library. Something like, e.g.: tikz('sk0.tex', ...
JPMD's user avatar
  • 311
1 vote
1 answer
169 views

Formatting like R in Latex document

I'm an extreme beginner. I would like to write the names of R packages like "lavaan" in the screenshot attached, but I really don't know how to achieve that. Can anyone help? I would only ...
Chiara Pellico's user avatar
0 votes
0 answers
35 views

Cannot compile correct fonts in LyX with sweave

Fonts in LyX look different when compiled without (first picture) VS with (second picture) sweave: What is happening and how can I resolve this issue? I'm using Windows 10, R 4.2.1 (with knitr and ...
pythonuser's user avatar
0 votes
0 answers
66 views

Header Issue when knitting with jpg image

I am new to markdown and have to generate a weekly report with the proper header including a jpg image. I have the following yaml --- title: "My Title" author: "Author Name" date: &...
a nony mouse's user avatar
0 votes
1 answer
230 views

R-Markdown pdfLatex won't work when rendering shape ="\U0001f693"

This is my first time using r-markdown and running into problems rendering the symbol above. Everything else works great. It also works in r in ggplot2 but won't work in r-markdown. When I include &...
mikeyisleany's user avatar
0 votes
0 answers
299 views

Error when including Hebrew characters in R markdown

I'm trying to create PDF report with R markdown. The report includes some Hebrew names as part of a table. When kniting the R markdown file, I get: ! LaTeX Error: Unicode character מ (U+05DE) ...
BoTz's user avatar
  • 101
0 votes
2 answers
269 views

Referencing results from an output table

I have been always wondering if there were an optimal way to perform this task in papers. So for example, in my field it is normal to present an output table from R (like linear regression) showing ...
Javier Moreno Sepena's user avatar
2 votes
2 answers
677 views

Using tikz with \pause command in rmarkdown or quarto presentation

I'm trying quarto for my slides and wondering how to use \pause in tkiz code. Minimum working example (Test.qmd) is below for reference. --- title: "Test Slides" format: revealjs: ...
MYaseen208's user avatar
  • 8,597
0 votes
0 answers
1k views

pdfTex error: invalid font identifier. Metric (TFM) file not found

I am using the LawTeX template: LawTeX. When I try to compile the PDF, I get a pdfTeX error: invalid font identifier. Font T1/pnc/m/n/10-pncr8t at 10.Opt not loadable: Metric (TFM) file not found. ...
Robert Cline's user avatar
1 vote
1 answer
5k views

the text is cut in the rmarkdown pdf file [closed]

As you can see in the picture, the text is cut off at the end of the page. What could done to prevent this? I have executed the following code and attached a pic for a better explanation. I would like ...
EnriqueGG's user avatar
0 votes
1 answer
398 views

R - Escaping a character from the BEST package for tikzDevice

I try to modify some plot output from the R BEST package with the help of the package tikzDevice. However, apparently tikzDevice can not proceed due to a parameter with a percent sign ("% HDI&...
17757970's user avatar
  • 323
0 votes
1 answer
843 views

Problem with footer in rmarkdown

I have been trying to add a footer to this report, generated with rmarkdown; however, whatever I do, it just doesn't work for me. --- header-includes: \usepackage{fancyhdr} \usepackage{graphicx}...
EnriqueGG's user avatar
0 votes
2 answers
550 views

Error in the code after loading a library in an R code

I have been writing a code in RStudio and using TinyTex to compile my pdf. I wrote the following code in an RSweave file in RStudio: \documentclass[12 pt]{article} \usepackage[utf8]{inputenc} \...
Devansh Kamra's user avatar
0 votes
0 answers
264 views

Problem Solved - Multiple issues with Sweave and Knitr

Here is the Github link of the files and a short description of the issues: https://github.com/Euniceisnice/What-is-wrong-with-my-Tex-and-Sweave I have never managed to compile my Rnw file with Knitr. ...
Eunice Ng's user avatar
0 votes
1 answer
68 views

How do I adjust these texts dynamically depending on length of name?

The following code \documentclass{article} \usepackage{eso-pic,graphicx} \usepackage[absolute,overlay]{textpos} \usepackage{fontspec} \setmainfont{Segoe UI Symbol} \usepackage[top=2cm, bottom=2cm, ...
bob0901's user avatar
  • 13
0 votes
1 answer
176 views

Help required regarding using inline R commands in overleaf

I am using overleaf to compile my R codes into a pdf file. For a chunk of code, we use for example: <<>>= mean(reading) max(reading) min(reading) @ But now I want to use these commands ...
Devansh Kamra's user avatar
1 vote
0 answers
22 views

How do I assign these variables from Rmarkdown? [duplicate]

I have variables that are going to be dynamic in this document. How do I assign theme from Rmarkdown. Below is how my .tex file looks like So for example $District_Name$ is a dynamic variable. I want ...
bob0901's user avatar
  • 13
2 votes
4 answers
252 views

Create an empty command

In my research, I do my analysis in R and write the paper in LaTeX. To avoid updating values in the paper when my analysis change, I update the values in the paper directly from R. Assume in R I have ...
Christian's user avatar
  • 131
0 votes
1 answer
93 views

How to avoid that xtable flips the x and y axis of a R table in the final tex output?

I work with xtable which turns a table of r into a functionable latex code. <<echo=false>>= attach(warpbreaks) p2 <- round(tapply(breaks, list(tension), mean), digits=2) %>% as....
user258614's user avatar
3 votes
2 answers
288 views

variable into TEX document?

I am trying to get a STATA macro or an R variable into Latex. This is relatively straightforward with R markdown, but I'm hoping for a pure TeX solution. e.g. say I have a document that says Our ...
Daycent's user avatar
  • 225
1 vote
0 answers
3k views

Cannot fix: ! LaTeX Error: File `pdflscape.sty' not found

I am using tinytex, Windows 10, R Studio install.packages("tinytex") tinytex::install_tinytex() and keep seeing the following error when I try to run a .Rmd file which contains \usepackage{...
Elis's user avatar
  • 11
1 vote
0 answers
91 views

How can I get R and Tikz to cooperate in a loop?

I'm using knitr and compiling my .Rnw file in Rstudio. Here's a MWE illustrating my issue. I want the code below to output "1, 2, 3" but instead it gives me "1, 1, 1". %%%%%%%%%%%%%...
Casey's user avatar
  • 11

1
2 3 4 5
13