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.

95 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
3k views

How to overcome LaTeX Warning: Command \@footnotemark has changed?

I'm using rmarkdown, and after knitting a document I always receive this warning (the document knits normal, though). Output created: XY.pdf Warning message: LaTeX Warning: Command \@footnotemark ...
jay.sf's user avatar
  • 425
4 votes
0 answers
1k views

Produce multiple documents using a loop in LaTex

I want to produce multiple documents in LaTeX. There is a list of values for every document that should be created, in the example it´s \mylist. My first approach was to use the \foreach function to ...
user avatar
4 votes
0 answers
1k views

TeX-function for writing R-functions

I'm working on an introductory course for the R-language in Latex, so I'm trying to write a Latex function that displays the R-function. This is what I've got: \makeatletter \newcommand{\fun}[3]{ ...
m00se's user avatar
  • 41
3 votes
0 answers
387 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 ...
MLithium's user avatar
3 votes
0 answers
391 views

Conditional output of LaTeX based on R parameter

I have a report I am working on using knitr which loops through results for a number of identical surveys and produces the same set of tables and figures for each. Some surveys have no data for some ...
Trevor's user avatar
  • 171
3 votes
0 answers
236 views

tikz stops drawing into pdf after 20 line segments in plot generated through knitr tikzDevice

Problem If I try to draw a curve generated through knitr using tikzDevice into .pdf only 20 line segments of that curve are drawn and TeXstudio, through which I do it, just leaves message running ...
VaNa's user avatar
  • 337
3 votes
0 answers
2k views

Best practice for ggplot transparency in pdf figures

I lost a couple of hours because of few transparent figures which Adobe Professional couldn't flatten to print (it crashed in the process). I wonder if there's any trick to produce PDF figures with ...
Francesco's user avatar
  • 4,524
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
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
2 votes
0 answers
693 views

Compilation problem with fontenc-Latex - LaTeX2e problem

Unfortunately, I am experiencing the same issue as reported in Compilation problem fontenc-Latex. I reinstalled my TeX installation and ran tlmgr update, all to no avail. I am using RStudio Version 1....
JKR's user avatar
  • 21
2 votes
0 answers
338 views

R and LaTeX: Why does white-space character disappear from path?

I'm creating a manual for an R package using LaTeX, and I have to follow a specific latex style . So, I want to create PDF using well known pdflatex, starting form .tex file generated by 'knitr'. ...
Mattia's user avatar
  • 21
2 votes
0 answers
380 views

Passing a variable from TeX to R in knitr

I want to use a variable that I define in TeX using \newcommand{} in the R code. Suppose I define following variables: \newcommand{\CourseCode}{MTH 123} \newcommand{\CourseSemester}{Fall} \...
HBat's user avatar
  • 499
2 votes
0 answers
2k views

what does "Error running C:/Users/user/AppData/Local/Programs/MIKTEX~1.9/miktex/bin/pdflatex.exe (exit code 1)" mean?

I am trying to run this code in Rsweave \documentclass[a4paper,12pt]{report} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \usepackage{fancyhdr} \pagestyle{fancy} \fancyhf{} \rhead{\...
sid satam's user avatar
2 votes
0 answers
235 views

glossaries with tikzDevice

I am using tikzDevice to run my R-scripts within latex. This is my code -- \documentclass{article} \usepackage[acronym]{glossaries} \usepackage{tikz} \makeglossaries \newacronym{gcd}{GCD}{...
novice's user avatar
  • 1,088
2 votes
0 answers
157 views

What is the counterpart in LaTeX for the R package ezknitr and its tools for managing paths and directories

Dean Attali has just added an R package called ezknitr to CRAN. It enables those who use knitr and RMarkdown in .Rmd files to handle directories quite flexibly. His blog describes it well: path ...
lawyeR's user avatar
  • 169
2 votes
0 answers
377 views

incorporating R code in latex, commentstyle not working

I have an issue with no all my R comments being colored in my latex file. I am using the listing package. My pre-amble code is \lstset{ % language=R, basicstyle=\footnotesize, ...
George's user avatar
  • 205
2 votes
1 answer
1k views

R-code linebreaks AND themes in knitr

hpesoj626 provides two great minimal working examples for how to get R-code linebreaks AND code highlighting in knitr. I was wondering if it was possible to use Yihui's knitr themes within either of ...
Flo's user avatar
  • 188
2 votes
0 answers
693 views

To get this WordCloud and R working in OSX's Texpad -1.6.0

I am trying to this Hamilton's code about WordCloud, which uses R, working in OSX. I have latest XCode and latest R 3.1.1 (XCode5 support) installed. Texpad 1.4.7-1.6.0 problem I open TexPad with ...
Léo Léopold Hertz 준영's user avatar
2 votes
0 answers
604 views

Knitr and numbers

I return to a question, which is few months old and then maybe not yet the best practice around. I use the siunitx package in my documents along with knitr to compile my R chunks. As far as I ...
Francesco's user avatar
  • 4,524
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
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
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
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
1 vote
1 answer
110 views

Illegal parameter number in definiton of beamer frame RMarkdown

While I want to render my Rmarkdown file as beamer pdf with Latex. I get the error: !Illegal parameter number in definiton of \beamer@doifinframe I get this only within the columns Tag. --- title: &...
dev123's user avatar
  • 11
1 vote
0 answers
278 views

Is there any tool/framework to convert R code into Latex?

I have a lot of code from R, and I'm working on a research project where I need to write down the pseudocode, is there any way to convert these codes into latex?
Felipe Augusto's user avatar
1 vote
1 answer
527 views

Color change in beamer at R markdown

Esteemed, I'm having trouble putting together a beamer presentation. I would like to put the title, the footer and the items in green tones. I appreciate any help. title: "long title" date: &...
Velton Sousa's user avatar
1 vote
0 answers
479 views

How do I insert a CFA output from R into Latex using lavaan and semTable?

I am not very experienced when it comes to Latex or R. As said in the title, I have a CFA output I generated with R Studio and now want to insert into Latex. Unfortunately, whenever I do this, my ...
non's user avatar
  • 11
1 vote
2 answers
1k views

R markdown / Plotly R with LaTeX unable to generate plot and get error on a file name with hyphen

I am using LaTeX for some formatting, and trying to generate a PDF file with a plotly R plot as a png. The following piece of code gives me an error as show below. It seems like a problem with the ...
Gopala's user avatar
  • 93
1 vote
0 answers
464 views

Images are not rendered with bookdown after updating packages

I am using bookdown with RStudio to create a pdf-book. After updating latex-packages with tinytex::tlmgr_update(), images were suddenly not rendered anymore, either with knitr::include_graphics() or \...
Haakonkas's user avatar
  • 171
1 vote
0 answers
304 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$} \...
cassius's user avatar
  • 123
1 vote
0 answers
4k 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 ...
Randall Helms's user avatar
1 vote
0 answers
2k 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 ...
jmich738's user avatar
  • 111
1 vote
1 answer
666 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: \...
Pawel's user avatar
  • 203
1 vote
0 answers
214 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(...
Siobhan's user avatar
  • 41
1 vote
0 answers
465 views

R Sweave: print very large dataframe sample which spans on multiple pages inside a floating environment

I'm using R Sweave to output an R document into a LaTeX file through R Studio on a Windows 7. I have a very large data frame from which I have to put a sample at the begin of my document. I use xtable ...
GaryDe's user avatar
  • 11
1 vote
0 answers
3k views

Specify multiple notes of a table by xtable

I want to create a table which may contain multiple notes like : which I found here. This works fine in a pure LaTeX context, yet I'm using knitr to convert my Rnw files (under R) to pdf, because ...
user133510's user avatar
1 vote
0 answers
93 views

Incorporating R code in problem sheets of probsoln

While working with the probsoln package, how can I include R code in problem sheets? My main document is \documentclass{article} \usepackage{probsoln, verbatim} \PSNrandseed{200} \begin{document} \...
venugopal's user avatar
1 vote
0 answers
234 views

R tikzdevice relative directories

I asked this on SO, but perhaps it is more relevant here: This is a problem which I face with many many plots. In R, Lets say I create a ggplot2 plot, with a colourbar: R> sample = ggplot(data=...
Nicholas Hamilton's user avatar
1 vote
0 answers
4k views

larger math fonts for R Markdown

I am looking for an "easy", i.e. not package dependent way of increasing the font size of the math equations I embed in my Rmd documents (eventually compiled by knitr). As an example: $$ \boxed{P(x=a;...
Markus Loecher's user avatar
1 vote
0 answers
823 views

general footnotes in xtable

I am using sweave to create pdf. Using xtable, I am trying to insert a general footnotes under the table (i.e: This symbol means bla bla bla). I've tried a lot of things and everything get me an error ...
Ludovic Auger's user avatar
1 vote
0 answers
832 views

Writing R code in TeXstudio

I have one chapter of my document which include R code. Whole document is written in TeXstudio. I need help regarding writing and executing R code using Texstudio. Regards
user97274's user avatar
1 vote
0 answers
80 views

Graphics prepared with Sweave and text disorder

I am preparing a report using Sweave, it is really beautiful, but the first introductory words of my pdf-file appear after the first R-plot! How to fix it? I would like to add that I've already tried ...
Mikitka's user avatar
  • 11
1 vote
0 answers
3k views

Error 43 while knitting a markdown to pdf in a R project created on mac and run on Windows

I created a R project which outputs some plots to pdf using rmarkdown::render with an .Rmd file. I shared the folder when the R project and all the relative files are kept to a colleague using Google ...
Bakaburg's user avatar
  • 111
1 vote
0 answers
121 views

Knitr Plot Tooltips for ADA Compliance

I would like to use Knitr to generate plots in R that have hover-over tooltips. Here is a working example without an R tooltip: \documentclass{article} \usepackage{pdfcomment} \begin{...
RTS's user avatar
  • 429
1 vote
0 answers
500 views

Extra Curly Braces when creating Xtable using Knitr, after specifiying size

I'm creating a R Markdown document using knitr and am running into trouble using xtable to create a table. My table is very large and I'm trying to reduce the size using the size command in the print ...
Rafael's user avatar
  • 11
1 vote
0 answers
769 views

ShareLatex knitr install package

Sharelatex comes with a few R library's that you can query. However, it is impossible for me to install a package or query a non pre-installed package. The package I am trying to use is the arm ...
Bobe Kryant's user avatar