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
1
vote
1answer
96 views

How to plot the DFT transformation of a vector with tikz/pgfplots?

My question seems to be simple but still I could not find any answer for that. Assume that we have a vector and its DFT which I computed it in R. > x <- c(3,9,4,2,5,6,2,6) > x [1] 3 9 4 2 5 6 ...
0
votes
1answer
22 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
1answer
70 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: %----- ...
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, ...
3
votes
5answers
4k views

Export plots from R directly to Latex

Is there a way to export plots from R directly to latex, more specifically TexStudio? I think exporting/saving the image from R and then importing it to R looses some of the quality. I saw on the ...
0
votes
2answers
113 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]. ...
2
votes
1answer
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 ...
1
vote
0answers
16 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 ...
0
votes
1answer
81 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
68 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} \...
199
votes
27answers
97k views

Workflow for converting LaTeX into Open Office / MS Word Format

I often have to write up reports based on the analysis of some data. I use R to analyse the data and export tables, figures, and text. This is then included into a LaTeX document either using input or ...
2
votes
1answer
32 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 ...
24
votes
1answer
13k views

How to build Knitr document from the command line

I would like to compile a knitr document from the command line. With Sweave, the sequence R CMD Sweave my_sweave_file.Rnw latex my_sweave_file.tex latex my_sweave_file.tex dvips my_sweave_file.dvi ...
9
votes
3answers
418 views

What tools are there to make LaTeX more viable at work

I do data mining in R, Python and various object oriented languages. I like using LaTeX to present my results; either to myself (i.e. use them for result interpretation/analysis) or to send to ...
1
vote
2answers
617 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 ...
0
votes
0answers
239 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
3answers
7k views

How can I nest a code chunk within an enumerate environment when using R Markdown?

When I attempt to do this using this code: --- title: "Title" author: "Me" date: "31 October 2014" output: pdf_document: includes: in_header: includes.sty --- \begin{...
3
votes
0answers
30 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 ...
0
votes
1answer
160 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
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
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 ...
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 ...
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 ...
1
vote
1answer
617 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: \...
1
vote
0answers
69 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{...
0
votes
1answer
279 views

Basic R code yields errors of “unclosed $” in knitr

I cannot use R code in Overleaf Knitr, since any basic code which includes $ yields error of unclosed $. Even the sample file of knitr in Overleaf itself causes LaTeX error: https://www.overleaf.com/...
1
vote
0answers
64 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
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 {...
0
votes
0answers
115 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 \...
5
votes
1answer
35k views

pdflatex not found (windows)

I am trying to exporty a pdf file from the R output using R markdown. I donwnloaded the MikTex, but when I tried to run the R markdown, it showed this error message: pandoc.exe: pdflatex not found. ...
0
votes
1answer
68 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
2answers
142 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(...
3
votes
1answer
6k views

How to make cross-references to sections/figures before they are introduced in R Markdown?

I'm using Rmarkdown and Bookdown to write an article. The issue I'm running into is with cross references and the order of introducing them and referring to them. For example, in this paper example, ...
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?
1
vote
0answers
34 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
1answer
405 views

long xtable() with align and footnote

have a long table and I would like to do a custom column width, with a footnote, the R code looks like below and align() to specific column width does not working? many thanks in advance, x <- ...
0
votes
0answers
59 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
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: &...
0
votes
1answer
90 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( ...
3
votes
1answer
105 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 ...
0
votes
0answers
49 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 ...
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
328 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
196 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 ...
1
vote
1answer
45 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
1answer
71 views

Sweave child rnw losing formatting

I have managed to get a master.rnw include a child.rnw, however, I can maintain the formatting of the child document based on the preamble in the master. Master.Rnw \documentclass[11pt,a4paper, ...
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
2 3 4 5
12