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
0 answers
37 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
207 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
27 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
79 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
39 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
43 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
108 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 ...
Myr TH's user avatar
  • 1
0 votes
0 answers
56 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
48 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
0 votes
0 answers
34 views

Plots from R to Latex

I'm doing my thesis and would like to know if there is any way to import the plots from R studio to Latex directly. As by saving them and importing them to Latex the quality is very poor. Thank you so ...
user366566's user avatar
1 vote
0 answers
578 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
57 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
59 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
29 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
31 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
186 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
201 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
132 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
1 answer
413 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,515
0 votes
0 answers
461 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
2k 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
245 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
  • 170
0 votes
1 answer
569 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
460 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
225 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
116 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
21 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
221 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
61 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
193 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
  • 205
1 vote
0 answers
2k 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
73 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 vote
1 answer
84 views

How to import a sentence from a .txt file that will preserve the font characteristics of the rest of the paragraph?

I have numbers from an R script that I would like to include in a report that I am typing in LaTeX. There are enough numbers that I am concerned about making a typo, and I don't want to do copy/paste ...
Dave's user avatar
  • 113
1 vote
1 answer
272 views

double quotation marks creates issues in listings [closed]

I'm writing a R code in LaTeX using the listing package. Everything works fine in the first two lines, with the code written in plain text and the comments in italic. However, after this string quote=&...
Jacopo Altieri's user avatar
0 votes
1 answer
53 views

R - sweave - count words

I could not find a clear solution, so I would like to ask if there is some tool to count words (excluding R - latex code) in a .Rnw file. Thank you!
mantoz's user avatar
  • 1
1 vote
1 answer
91 views

R sweave - stop tables from floating

Please excuse my naive question: I am using R studio sweave with xelatex and tinytex I run this chunk to produce a table, but it is automatically printed on the last page, adding a huge blank space ...
eirini's user avatar
  • 31
1 vote
1 answer
442 views

Updating R Counter in for loop

I have written a for loop in LaTeX using the forloop package, and on each iteration, I would like to use a different subset of a vector that is defined in an R chunk above. However, each iteration of ...
Brendan Lukomski's user avatar
1 vote
0 answers
135 views

Aligning note text to the left in a regression table produced by R (etable) [closed]

My R function (etable) provides me with the following latex table: \begin{tabular}{lcc} \tabularnewline\midrule\midrule Dependent Variables:&Earnings&Employment\\ Model:&(1) & (2)\\ \...
RobustTurd's user avatar
2 votes
1 answer
55 views

Aligning a TeX Code appropriately in LyX

I'm a bit new to using LyX to typeset my R code (using the Rnw(knitr) module) into a pdf. While working on it, I came across a problem. Say, for example, I have a dataset in the form of a table like ...
DeBARtha's user avatar
  • 163
1 vote
1 answer
1k views

! LaTeX Error: File `tikz.sty' not found in R Studio MacBook Air

This is a new user of R. TikzDevice and ggplot2 have been installed in R Studio on MacBook Air. An error occurred when trying to run the blue code in the screenshot. I tried to use tikzTest() to check ...
Water's user avatar
  • 11
0 votes
1 answer
2k views

LaTeX Error: File `suffix.sty` not found

I would like my R Sweave file to run smoothly in Rstudio. I have tried to compile the following: \documentclass[a4paper,12pt]{article} \usepackage{amsmath,natbib} %\usepackage[utf8]{inputenc} \...
Tinius's user avatar
  • 1
1 vote
1 answer
560 views

!pdfTeX error: pdflatex (file t1-zi4r-0): Font t1-zi4r-0 at 540 not found

My issue is same as this problem Error: Font ts1-zi4r at 540 not found In my case, I am running Rstudio server on a remote machine for work. When trying to build the vignette/manual pdf I get this ...
utsab shrestha's user avatar
3 votes
0 answers
137 views

R Code with minted, "¡-" instead of "<-" and underscores are omitted [duplicate]

I am using overleaf to write a LaTeX document. I want to include some R code blocks with minted, but minted displays my arrows in the code "<-" like this: "¡-". How can I fix ...
Zoe's user avatar
  • 163
1 vote
0 answers
109 views

Why are my plots not appearing properly? [closed]

I got a new laptop last week and installed TexStudio and TexShop. When using TexStudio, my pdf plots from R aren't displaying properly. An example is below. This is it in TexStudio: But this is the ...
Tom's user avatar
  • 11
1 vote
0 answers
607 views

inline Latex in R markdown

I have a question about inline R Markdown code: I have a finished LaTeX table that looks like this: \begin{table}[!h] \centering \begin{tabular}{ |c|c|c|c|} \hline $\textbf{Vorname}$ & $\textbf{...
stefanR's user avatar
  • 11
1 vote
0 answers
906 views

LaTeX expressions in xlabel of R plot

Im trying to print $\lambda = $ lambda" (where lambda outside of the dollar signs is a variable) on the xlabel of a plot I'm making in R using the latex2exp package. When I use: xlab = paste(TeX(...
Robert's user avatar
  • 11
1 vote
0 answers
1k views

RStudio, pdflatex fails to knit to pdf and crashes

I'm trying to compile a simple Rnw file in RStudio using knitr's "compile pdf" functionality. But it gives me an error. This is what I have in Vorlage.Rnw: \begin{document} Hello World \...
Kris's user avatar
  • 11
0 votes
2 answers
2k views

TeX("$\lambda$") doesn't work in R

Im using the latex2exp package to make some plots in R with latex expressions in the labels. TeX("$\lambda$") on the xlabel doesn't print what it needs to. The documentation said to use TeX(...
Robert's user avatar
  • 11
0 votes
0 answers
24 views

Misspecify $ in-text [duplicate]

the following equation is kind of creating an issue when I'm typing it in-text $\frac${$\partial$ LL}{$\partial$ $\Omega$}$ Am I mis-specifying $ anywhere?
Alexa Thomas's user avatar

1
2 3 4 5
12