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.

99 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
250 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 ...
0
votes
0answers
20 views

possible to manually add spaces in front of cells in kable table with latex in R. Excel does not maintain spaces in front of specified cells

Is there a way to place spaces in front of specific rows? The excel table that I import does not keep the spacing before the that I add. row_spec align values do not work and I am using latex. I would ...
0
votes
0answers
132 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 \...
0
votes
0answers
60 views

How to export an interactive graph from plot to Overleaf without converting it into a static one in R

I am currently involved using an interactive world map of this kind https://www.youtube.com/watch?v=RrtqBYLf404 I have two possible questions that may solve my problem: Do you know how to include the ...
0
votes
1answer
74 views

Export descriptive statistics by group from R to LaTeX without exceeding width

I am trying to reproduce, in LaTeX (Overleaf), a table of summary statistics divided by country-year. The table I got is exceeding width and I can't solve it with solutions I've seen in other ...
0
votes
0answers
63 views

Missing number, treated as zero.for ifnumcomp in tinytex using R

I have an project that I am compiling using TinyTex. When compiling the project in R using tinytex::pdflatex('dissertation.tex'), it gives error as shown below. ! Missing number, treated as zero. <...
0
votes
0answers
51 views

How do I include R generated plots in LaTex?

I use R for data analysis and to create quite complex graphs. Now I am looking for a nice (and easy) way to include my plots in LaTex. Preferably, vector-based and automatically with the font I am ...
0
votes
0answers
358 views

R font in latex

I wanted to describe some R packages in latex document and I'm wondering what font (and how to use it like 5 times) is usually used in names of packages?
0
votes
0answers
15 views

Long commentaries lst (R)

I am making a Latex docuemnt where I have to input some code in R with the command \lstinputlisting. I have my own style defined with the following configuration: \lstdefinestyle{mystyle}{ ...
0
votes
0answers
13 views

lstlistings in a two column setup

How can I use lstlisting in a two column setup, meaning that the code block is spreading over both columns? (lstlisting* is not valid.) - I dont want two listings side by side!
0
votes
0answers
145 views

How do you align latex to left side of knitted pdf in rstudio?

I'm creating a notebook in rstudio for the first time, and I need to knit a pdf with latex. At the moment, I have latex in the middle of the document, but I'd like it aligned to the left, as the red ...
0
votes
0answers
203 views

Cannot install R packages in the Knitr environment Overleaf

I am trying to write my R code directly in my Overleaf document using knitR. However, this message pops up when I run the following code:
0
votes
0answers
307 views

Figures showing at the end of the document in R markdown

I have been working on this issue since yesterday and have checked almost all the solutions but I'm still not able to solve this issue. All the figures and tables I put in the document shows at the ...
0
votes
0answers
181 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 ...
0
votes
0answers
49 views

Can I tell TeX not to interpret $$ at all?

I'm working with survey data in R. We have a bunch of text answers to open ended questions that I just want to dump into a readable table with Knitr's Kable function. Unfortunately, some of the ...
0
votes
0answers
58 views

Error compiling latex-table from semTable package

I'm trying to compile a PDF in texmaker with a table from the semTable-package in R. Unfortunately, I'm getting an error when doing so. Since I'm a massive greenhorn with LaTex, I would be very happy ...
0
votes
0answers
13 views

Color for the text when using “lstlistings” with R text

I am using the environnement "lstlistings" to insert chunks of R in a LaTeX paper. I would like to have the text of R commands in blue color and the output of R in red color. How can I do ...
0
votes
0answers
31 views

knitr: change the tidyverse italic font in Soutput environment comments?

In printing a tibble, for example, the output begins \begin{Soutput} # A tibble: 30 x 2 cond rating ... # … with 20 more rows \end{Output} The output formatting is defined by \usepackage{listings}...
0
votes
0answers
51 views

I updated MiKteX some days ago (11/08); Since I dit that, “lstlisting” doesn't work

I want to include R code in a tex source by using the environment lstlisting from the package listings. It is a paper I began to work on some weeks ago. The inclusion was working correctly during some ...
0
votes
1answer
164 views

Leave Header Blank Fancyhdr

I am new to coding and Latex so please forgive me as I'm sure this is a very straight forward solution. I am creating a PDF report using RMarkdown with a .tex file to control the header, margins, and ...
0
votes
0answers
433 views

How to indent a numbered list of references in R markdown as in latex?

I post this same question in stackoverflow (https://stackoverflow.com/questions/61060820/how-to-indent-a-numbered-list-of-references-in-r-markdown) and I was suggested to ask here. So, my problem is: ...
0
votes
1answer
67 views

latex - includegraphic with variables in the name

I'm no pro when it comes to latex and I'm working on something that's already been a bit established. I have a batch that produces multiple pdfs with a latex/sweave template. I'm attempted to insert a ...
0
votes
0answers
107 views

How to call TinyTeX from text editors (command line)?

I use some editors like TeXstudio, etc., and they work with "command line" commands like (example with TeXstudio and pdflatex): pdflatex --shell-escape %.tex In this case, % is a variable for the ...
0
votes
0answers
358 views

RMarkdown PDF Fatal error : Undefined control sequence (\grffile@filename). Possible Bad Character?

I have written a R script to generate 2 RMarkdown PDF reports for a given dataset. The script runs without error on my main Linux machine with Texlive. I adjusted it for my work laptop with Windows ...
0
votes
0answers
105 views

Getting %*% using listings for R

I am getting an error when importing R code into latex with the %*% symbol for matrix multiplication. How do I edit the following in order to allow me to add %*% from R to latex output without ...
0
votes
0answers
73 views

Make documents where the date printed on the document is automatically the date of creation of document

Is there a way to create latex documents where the date printed on the documents is always by default the date of creation of the document? I don't want to compile the same latex file 30 days later ...
0
votes
2answers
119 views

Bookdown bibliography with natbib omits URL for web pages

I am creating a pdf-book using bookdown, with the citation package natbib in the apalike style. I get my citations from a .bib file created by mendeley. I create my citations like this: [@citation]. ...
0
votes
0answers
148 views

Including R code in latex

I have some problems by inverting my R code into latex and than copying the code of the pdf back into R. I used lstlistning to read the R code and since it did not show the -, I used this code: \...
0
votes
0answers
4k views

How to add cover pages to rmarkdown pdf file?

I need to add a coverpage at the very begginning and end of a pdf document i have made using R Markdown. (My first time using R markdown and latex) As it is now, the first page of the file output is ...
0
votes
0answers
114 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 &...
0
votes
0answers
785 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 ...
0
votes
0answers
254 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
0answers
731 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 ...
0
votes
0answers
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 ...
0
votes
1answer
511 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 ...
0
votes
0answers
97 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 ...
0
votes
0answers
203 views

Is it possible to nest multiple overset? otherwise how?

I have a ggplot2 plot for which I'd like to align text to some plot related boundaries e.g. between axis ticks. The process that creates the annotation text is automatic and needs to account for word-...
0
votes
0answers
451 views

How can I preview the output of a RNW file?

I currently create pdfs in RStudio by calling the knit2pdf function on a RNW file. However, when playing around with the LaTeX formatting in the RNW file, I'm wondering how I can preview my results? ...
0
votes
0answers
82 views

Why is an extra page inserted before the cover page when changing page colors for a single page?

I am using R and the knitr package to produce a LaTeX PDF. As the MWE below demonstrates, an extra, blank page is created before my boxed page, which is to be the cover of a book. If I remove the ...
0
votes
0answers
309 views

With R, knitr and RStudio, how do you compile a .dtx file to get the .sty file needed for a package?

Working through Stefan Kottwitz's LaTeX Cookbook, page 82, I tried to use the package pullquote. I am using R, the knitr library and the RStudio IDE. When I compiled the .Rnw script that has the ...
0
votes
0answers
111 views

R-codes in LaTeX using listings

I use the package listings to include R-codes in my project. Unfortunately, it produces (sometimes, but not always) a hanging indent in the pdf document. Is there a possibility to erase this ...
0
votes
0answers
362 views

R, Metafor package and Latex output

I have a problem in exporting output produced in R using the metafor package to latex. The object I'm trying to export are few rma and rma.mv outputs. As example, I'll post some output of the rma ...
0
votes
0answers
2k views

Encoding error when knitr -> LaTeX -> PDF

I have a document written in knitr. I can export it to HTML and docx, but not PDF for some reason. The Rmd file is here http://cl.ly/dJka?_ga=1.30252732.2076817589.1442770201 It says ! Package ...
0
votes
0answers
290 views

R to LaTeX with knitr and pandoc (error in a guide)

I want to follow the guide http://kieranhealy.org/blog/archives/2014/01/23/plain-text/ since my document http://rpubs.com/lindberg/110268 need to be pushed to latex for a better read. The tex says "...
0
votes
0answers
419 views

How to create tikz figures via knitr forcing labels featuring LaTeX's font size modifier-commands?

Is there a way to force knitr to create tikz code which includes font size information? The output would be something like this: \begin{tikzpicture}[every node/.style={font=\footnotesize}] Here is ...
0
votes
0answers
706 views

best way to capture R output into latex table

I am running a bunch of models in R using the caret package. This package is an interface to many modeling techniques and methodologies. There are certain output of each model I'd like to convert to ...
0
votes
0answers
254 views

R data.table and knitr

I have an automated report that i produce using knitr. i'm running across the oddest problem. I wrote a function that sums the data by month for several locations. when i run this function in R i ...
0
votes
0answers
670 views

Sweave's “fig=TRUE” cannot write file

I use Sweave to get my R data into LaTeX. While this works fine with "just data", I am not able to include plots. My .Rnw-file looks like this: \documentclass[a4paper,10pt]{article} \usepackage[utf8]...

1
2