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
20 views

RMarkdown to PDF using Fancyhdr - Control spacing after headrule

am creating a series of PDFs in an RMarkdown loop, and can't figure out how to control the spacing between the lines created with \headrule and the start of the text within the r chunk. My attempts ...
0
votes
1answer
27 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 ...
1
vote
0answers
17 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)\\ \...
1
vote
0answers
21 views

How to generate a table where each cell is the alpha (and standard error) of a different regression [closed]

I am trying to replicate the following table using R: I have the coefficients and the standard errors in a melted table. I know how to transform them into two different tables (one for coefficients ...
2
votes
1answer
33 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 ...
0
votes
1answer
92 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 ...
0
votes
1answer
70 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} \...
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 ...
3
votes
0answers
32 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 ...
1
vote
0answers
44 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 ...
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 ...
1
vote
0answers
74 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{...
1
vote
0answers
71 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(...
0
votes
0answers
133 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
2answers
149 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(...
0
votes
0answers
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?
0
votes
1answer
42 views

Several error in equation typing

This is my equation. \begin{equation} E$\epsilon$$\epsilon$=V$_$$\epsilon\$=$\Omega$ \end{equation} These are the errors that I'm receiving Dispaly math should end with $$ Missing $ inserted Missing {...
1
vote
0answers
36 views

Error in trying to write $\bar{X}$ in R markdown [closed]

I want to write the distribution of the average of n i.i.D's. However I keep receiving the following error when I write the following in R markdown. $$\bar{X}\sim N(\mu_X,\frac{\sigma^2}{n})$$ Error: ...
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
77 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. <...
1
vote
0answers
28 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: &...
1
vote
1answer
72 views

Help rendering booktabs tables in RStudio

Can I use the booktabs package in R? I am using RStudio and could not find a way to install a version of the booktabs package. The table I am trying to render in a .Rmd file is provided below: %----- ...
0
votes
1answer
91 views

How to put parentheses for multiline text in r markdown?

Could anybody help me to overcome this? I've tried several ways but it still didnt't work. I wanna put big parentheses for these three line texts like the image below but I couldn't do it. $$\left( ...
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 ...
3
votes
1answer
106 views

How to load additional packages with R::rticles?

I mostly code in R, and have been using knitr Rnw for a while, mostly following the best practices outline in 14mech14's YouTube videos, with a parent rnw document, child rnw document, and a document ...
1
vote
2answers
70 views

Underline text with === (SETEX style)

I'm trying to recreate the typewriter look. How to make \underline{sometext} work like SETEX-style section marker? The intended use is with monospaced/typewriter fonts for lines with plenty of space ...
0
votes
0answers
360 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?
1
vote
1answer
205 views

Including images in an R code chunk of R sweave using for loop

I am new to sweave and Latex. I am basically using an if-else loop which should display some specific image (taken from the laptop) if certain condition is satisfied. When I run this loop in R, the ...
0
votes
1answer
90 views

\textwidth is not recognized, causes illegal unit error

I switched computers, reinstalled R, and am now getting an "Illegal unit of measure" error when I run the following code. I've narrowed it down to the "\textwidth" portion - when I ...
1
vote
1answer
46 views

Question about using book down in R-do I need to load packages on each page? Help with basic understanding!

Please forgive the v basic question. I have recently started using R bookdown, to try write papers. I've read the cookbook and book down guide. I use rmardown, and understand that, but I don't ...
1
vote
2answers
57 views

How to conditionally display in bold a R generated p-value with the symbol < (<0.001 or < 0.001)?

I have LaTeX tables being automatically generated (populated) via R (Rstudio, Knitr), and compiled with PdfLaTeX (MiKTeX). There are rows of p-values for each statistic test. I am using this ...
1
vote
1answer
28 views

How to include Rd2pdf latex file as appendix in document

I Have created an R package, I want to include the documentation as an appendix in my Thesis document. To create the latex file I did the following (I am partly including this to make it easier for ...
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
1answer
35 views

R ztable latex output not working

I created a table using the ztable package in r. I cannot get the output to work in LaTeX though. I am getting error messages like this; l.74 \definecolor {tempcolor1}{rgb}{0.98,0.41,...
1
vote
0answers
32 views

Executing R Codes (Dynamics Reporting) in LaTex Beamer [closed]

Dear all LaTex experts, I am trying to writing some R codes and execute it in a LaTex beamer environment, or what is commonly known as dynamic reporting, but in beamer. The editor that I use for LaTex ...
1
vote
0answers
77 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?
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 ...
1
vote
1answer
63 views

Getting error of including $, when it is not necessary [closed]

Hi all I have the following code in r: $$ln(L(\lambda))=(\sum_{i=1}^{n} y_i)(ln(\lambda))-n\lambda$$ when trying to knit the document I get an error that says: I have never gotten this error before, ...
1
vote
1answer
40 views

How to pass a variable from Rmd file to a latex file

I have two file 1. index.rmd file and the other is 2.Preamble.tex file I want to delclare a variable in index.rmd i.e. a <- 'Start and end with single quote' I want to pass the above variable in ...
1
vote
1answer
33 views

extract all the xtables in to the one .tex file from r

I have two xtables in my R script and I would like to extract them the same .tex file then I can call them to my main.tex with \newcommand print(xtable(head(mtcars), digits =2, caption = "...
1
vote
0answers
74 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: &...
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
1answer
73 views

How can I format R codes in a 'normal' sentence in LaTeX in the language of R?

I'm new to latex and trying to put my R codes in latex, which I have done in the following way: \lstset{language=R, basicstyle=\small\ttfamily, stringstyle=\color{DarkGreen}, otherkeywords=...
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 ...

1
2 3 4 5
12