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.

68 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
761 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]{ ...
3
votes
0answers
183 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 ...
3
votes
0answers
288 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 ...
3
votes
0answers
761 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 ...
3
votes
0answers
224 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 ...
3
votes
0answers
1k 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 ...
3
votes
1answer
232 views

Include .Rtex as a chapter in latex

I have an Rtex that contains: \documentclass[openany]{book} \chapter{Introduction} \input{./Introduction/Introduction} \chapter{Thesis Outline} \input{./Outline/Outline_Chapter} \bibliographystyle{...
2
votes
0answers
248 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'. ...
2
votes
0answers
267 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} \...
2
votes
0answers
144 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}{...
2
votes
0answers
139 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 ...
2
votes
0answers
230 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, ...
2
votes
1answer
892 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 ...
2
votes
0answers
591 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 ...
2
votes
0answers
520 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 ...
1
vote
0answers
128 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$} \...
1
vote
0answers
2k 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 ...
1
vote
0answers
100 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(...
1
vote
1answer
515 views

R code and Sweave output - EDIT

UPDATED Question 1 In the lattest update of KnitR the output is clean as what I expected. Maybe an update was made. The new output : Before update I'm trying to get a particular output with Sweave ...
1
vote
0answers
182 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 ...
1
vote
0answers
1k 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 ...
1
vote
0answers
82 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} \...
1
vote
0answers
549 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{\...
1
vote
0answers
2k 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;...
1
vote
0answers
599 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 ...
1
vote
0answers
637 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
1
vote
0answers
58 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 ...
1
vote
0answers
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 ...
1
vote
0answers
98 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{...
1
vote
0answers
370 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 ...
1
vote
0answers
649 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 ...
1
vote
0answers
488 views

Changing lisoffigures color in Rmarkdown

I'm using Rmarkdown with Rstudio to create PDF, and I add the option \listoffigures, but the font color of the links are pink. I tried to add some TeX option to change it like \listoffigures{"...
1
vote
0answers
639 views

Compiling .Rnw file into PDF in RStudio (Error: No file or directory)

I have a .Rnw file. I usually can "Compile" it into a PDF file in RStudio. However, I recently upgraded my R Version to 3.2.0. Now, when I try to "Compile" my .Rnw file I get an error: /Library/...
1
vote
0answers
57 views

Including graph using tikz causes not including bibliography file

I am experiencing problems using package tikz. I have produced a graph in R and want to include it in my tex file using package tikz. After I include the the tex file with graph in myfile.tex with ...
1
vote
0answers
649 views

Problem using tikzDevice in knitr

I can't seem to get knitr to work with tikzdevice. A simple example: \documentclass{article} \begin{document} <<test, dev='tikz'>>= library(knitr) library(tikzDevice) library(ggplot2) ...
1
vote
0answers
549 views

knitr: Several figures with subcaptions, alignment issues

Here is a minimal working example: \documentclass{article} \usepackage{subfig} \begin{document} <<echo=FALSE,out.width="0.49\\linewidth",fig.show="hold",fig.align="center",fig.cap="Some ...
0
votes
0answers
43 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/...
0
votes
0answers
28 views

When trying to compile a Rnw/sweave file I get a message that it failed, but it shows no warnings

I'm getting the following message: You can now run (pdf)latex on 'west-comparisons.tex' There were 50 or more warnings (use warnings() to see the first 50) Running pdflatex.exe on west-comparisons....
0
votes
1answer
25 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
46 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
383 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
17 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
405 views

Ubuntu 18.04 LTS Texlive 2018 ! LaTeX Error: File `ulem.sty' not found

After installing tinytex R package, I started getting LaTeX error regarding missing .sty files. One such error is LaTeX Error: File `ulem.sty' not found. I used the following code Checked Texlive ...
0
votes
0answers
209 views

Latex with rmarkdown (RStudio)

What must I do? This is pdfTeX, Version 3.14159265-2.6-1.40.19 (MiKTeX 2.9.6930 64-bit) entering extended mode Sorry, but C:\Users\Silvano\AppData\Local\Programs\MIKTEX~1.9\miktex\bin\x64\pdflatex....
0
votes
0answers
23 views

Indexing terms being used in cross-referencing

This is a follow-up question of my previous one: Cross-referencing numeric values and text from later section to executive summary of a latex document I have finished making my report and now my boss ...
0
votes
0answers
181 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
89 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
1answer
42 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
0answers
256 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
973 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 ...