Questions tagged [sweave]

Sweave is a function in the statistical programming language R that enables integration of R code into LaTeX or LyX documents.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

RStudio knits weave and miklatex/mactex

which is the best place to start for a newbie latex with rstudio and sweave/knitr i need to make mathematical calculations and simple plots of sales over time
0
votes
0answers
10 views

Sweaving .Rnw file: How to include “message” from R function?

I am currently working with myfile.Rnw file in R-studio to create .tex file. I want to include "message" generated from the R function StabCat(), but somehow message are not being included in the .tex ...
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
0answers
83 views

Convert Tex file into PDF? [closed]

I am new to R. I am currently working with R markdown and Sweave. I’ve heard that Sweave can do complex calculation and that the reports are better looking than with R markdown. This is what I did, ...
1
vote
1answer
61 views

How to avoid the extension files when I compile pdf on r sweave

I face a problem when I compile pdf file I got many files in the working directory, for example, the files Untitled.tex and Untitled.toc along which my files Untitled.pdf and Untitled.Rnw. Can anyone ...
2
votes
1answer
56 views

Class tufte-book and R listings code box width problem

When I run the following MWE: \documentclass{tufte-book} \usepackage{Sweavel} \usepackage{amsthm} \usepackage{mathtools} \usepackage{soul} %%%%%%%%%% % R example %%%%%%%%%% \newtheoremstyle{rex}{}{...
5
votes
1answer
681 views

How to insert references and bibliography into a .Rnw file produce with RStudio R Sweave and knitr?

So far, I have successfully used RStudio and R Markdown to write scientific papers and insert citations from the medical literature without significant problem as shown in the minimal example (MWE) ...
0
votes
0answers
134 views

Overfull hbox within an R output

I'm using Sweave to work with R in a LaTeX document and when I compile my script I get the following badbox, as showed in the log file: Overfull \hbox (14.62822pt too wide) in paragraph at lines 127--...
0
votes
1answer
91 views

How to use if-else statements in sweave documents

Is there a way to use an if-else statement in an sweave document, so that a figure is only shown depending on the value of an R object. I tried different approaches (two of them are below), but I did ...
3
votes
1answer
114 views

Compiling a .tex file into many pdf without include?

I would like to have a single .tex file, with a main section and an appendix. I would want however to compile it into two distinct pdfs. There are solutions using \include, see How to create ...
2
votes
1answer
217 views

Caption in Sweave after an R plot

I have the following R chunk: <<echo=FALSE>>= par(mfrow=c(3,1)) #cas basal: no negra no fumadora sense prematurs ni hipertensi? lwt.pred<-seq(80,250,1) prob.pred<-0+model.final$...
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, ...
1
vote
0answers
56 views

Greeks Letter in RStudio + Sweave

This is my Rsweave reproducible code: \documentclass{article} \usepackage[a4paper,left=1.5cm,right=1.5cm,bottom=1cm,top=3cm]{geometry} \usepackage[perpage]{footmisc} \usepackage{csquotes} \...
1
vote
1answer
280 views

Bibliography output in RStudio with multiple references

From this link I was able to replicate the references result. https://texblog.org/2013/08/20/rknitr-automatic-bibliography-generation-with-biblatex-in-rstudio/ How can I add more than one output? ...
1
vote
0answers
36 views

Sweave barplot label alignment [closed]

when I compile a horizontal barplot in sweave, I get inconsistent justification for long labels (not right justified). However, when I export the barplot with RStudio, the labels are correctly aligned....
1
vote
1answer
73 views

Sweave outputing ascii unicode

i have a file .Rnw with non unicode characters in utf8. When I compile with Sweave(file, encoding="UTF-8"), the .tex output has the unicode characters in the form <U+00F3>. How can I get the ....
1
vote
1answer
513 views

How to re-run Bibtex on the file(s) - RSweave; KnitR

I have a document called Code.Rnw where I write my document in and I'm using Sweave and Knitr to compile it. For my bibliography I use biblatex. My setting is the following: \usepackage[bibstyle=...
1
vote
2answers
253 views

Passing a string into Sweave Rnw file

I understand from this question that it's possible to push a variable to an Rnw file from the R script that calls it by storing that variable in the global environment within the R script. I've tried ...
2
votes
1answer
889 views

Excessive blank space after a graphic using R and kntir

The problem is the following: I want to have the text from section 6 way closer to the graphics. This is the code I am using: \documentclass{article} \usepackage{graphicx} \usepackage{microtype} \...
0
votes
1answer
87 views

Marginfigures, environments and scrlayer-notecolumn

I am writing an article in Sweave (knitr), which is a translator from the statistical language R to TeX. Whenever I produce a figure in Sweave it returns something like the following code for 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(...
0
votes
1answer
3k views

Looping through data frame and adding each value in column to PDF

Please bare with me as im UBBER new to creating pdfs in R Studio. My R code grabs a bunch of files from an ftp site and for each of these files I loop through and create a pdf...all this works great. ...
3
votes
0answers
289 views

Proper ERT LaTeX Code in LyX Math-mode

The problem I am having is I cannot have full "monospaced font" ERT code in LyX math-mode. In the picture below, you can see that in math-mode there is no red box and the argument in the curly ...
0
votes
1answer
163 views

How to make several minipages with images be on one page

Consider the following code \noindent Some text here \begin{minipage}[t]{0.49\textwidth} \hspace{-30pt} \includegraphics[width=300pt]{img1} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \...
1
vote
2answers
646 views

Compiling a Latex-Sweave child into a main Latex-Sweave file

I'm in the process of writing my thesis, where I have two chapters ready. I'm looking to unify those two chapters into one single Sweave file. Suppose I have a folder called chapter1 which contains ...
0
votes
0answers
52 views

Hiding minipage if it contains not existing image

Consider a sequence of something like the following \begin{minipage}[t]{0.49\textwidth} \includegraphics[width=200pt]{figs/fig_12345_1.pdf} \end{minipage} \begin{minipage}[t]{0.49\textwidth} \...
1
vote
1answer
514 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 ...
0
votes
1answer
540 views

Trying to get rid of the included chunk in sweave document.

I just translated the mosaic manuals and I'm giving format to them. I'm using this chunk for all the packages, but it's still printing me the whole chunk at the first page of the book: <<...
1
vote
0answers
363 views

Can't compile a PDF with UTF-8 in Sweave [duplicate]

I try to compile in Sweave (R Studio) a PDF which contains cyrillic characters. The PDF-file looks nice, and the cyrillic characters display correctly. But when I try to copy some text from the PDF to ...
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} \...
4
votes
1answer
427 views

Can't set singlespacing for code chunks only

I'm just going to put the question inside an example .Rnw code block. It's easiest to see the problem when this is compiled into a .pdf file. I'm using pdfLaTeX and knitr to compile the file from ...
3
votes
1answer
3k views

Putting a user defined Latex environment into R markdown or knitr

I am getting an error when I try to include a user defined environment in my R markdown document. I have at the top: header_includes: - \usepackage{amsmath} - \usepackage{amssymb} - \usepackage{...
-1
votes
1answer
540 views

Dynamic word count for abstract environment in LaTeX using Knitr/Sweave/Rstudio

I am attempting to use TeXcount to count the number of words in my abstract environment and print it out, so that when I update the abstract it prints the new word count. I did my best to search the ...
2
votes
1answer
292 views

Modify the layout of a Table-1 filled with data from R

I want to fill automaticly data from R into a table for a TeX-document. Sweave and Knitr are possibilities here. Please feel free to add more. (I know Sweave and Knitr are R package but the focus of ...
0
votes
2answers
493 views

R Sweave not interpreted correctly due to writing style?

This case won't get correctly interpreted. I doubt it must be to do something with my writing style but I cannot notice what it is. You can run it with R CMD Sweave Test.Rnw; pdflatex Test.tex ...
2
votes
3answers
141 views

How to create a horizontal space of a desired length when creating a Table

I am new to LaTeX. Started yesterday. I've been working with R and am doing so now but found that it is possible to produce very nice tables with LaTeX.I have been searching and found some code that I ...
1
vote
0answers
546 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
1answer
210 views

Sweave breaking on escape characters? [closed]

I'm attempting to build out a pdf using texworks and sweave. I can get an output just fine except for a certain chunk of code and I can't tell why. Here's an example of it working: \documentclass[...
3
votes
1answer
8k views

includegraphics scale not working

Im trying to change the size of the picture with "scale" but is not working \documentclass{report} \usepackage{graphicx} \usepackage[left=1.5cm,top=1cm,right=1.5cm,bottom=1cm]{geometry} \begin{...
1
vote
0answers
120 views

Prevent .tex file from opening automatically when working on .Rnw in TeXStudio

I'm working with a Sweave (.Rnw) file in TeXStudio (2.11.0). I have set up custom build commands to knit the Sweave file to LaTeX, with the idea to work on the .Rnw file exclusively. My problem is ...
1
vote
0answers
150 views

Fontspec, Sweave and MacTeX 2016: Font shape undefined

When I compile the following MWE with xelatex, compilation goes fine but I get this warning message: Font shape T1/TimesNewRoman(0)/m/n undefined(Font) using T1/cmr/m/n instead. The problem appeared ...
0
votes
2answers
758 views

how to make a graphic bigger

I've made the following syntax: \begin{figure}[ht] \caption{xxx } \centering <<echo=FALSE,fig=TRUE >>= load("//d049nt01/estudios$/Indicadores de Liquidacion/Tablas de prueba/pago_agg.rda"...
2
votes
0answers
2k views

Sweave error running pdflatex.exe (exit code 1) [closed]

I'm new to sweave, and I keep getting errors. I'm trying to run the following file: \documentclass[a4paper]{article} \begin{document} \SweaveOpts{concordance=TRUE} Hello world! \end{document} ...
2
votes
1answer
112 views

Knitr/Sweave Format Code Output w/ Leading Characters

Using knitr/sweave, I need to format the R code output that gets echoed, according to editorial journal requirements. For example, the following chunk <<example,echo=TRUE>>= library(plyr)...
3
votes
1answer
184 views

No increment of a variable in a Sweave code chunk which is wrapped by a \whiledo loop

I already searched in different forums but until now I couldn’t find a solution. So I hope that you can help me… Like mentioned in the title there is no increment of my variable x in the code chunk ...
1
vote
0answers
77 views

RNW, different sections depending on the value of a variable. Possible? [closed]

I am new to RNW files, and I am not sure if the following is possible. Suppose that I have the following RNW file: \documentclass[12pt,a4paper]{article} \usepackage{Sweave} \usepackage{amsmath} ...
3
votes
2answers
3k views

Tables with reference to R objects in sweave / latex

I'm using knitr/R-sweave to produce a pdf-document wit LaTeX-code. I want to make a table with some numbers produced by some R calculations in the R-code-chuck above this table. When I usually want to ...
1
vote
0answers
597 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 ...
2
votes
1answer
221 views

Set TeXstudio for Unicode .Rnw files (Sweave)

I tried to run Sweave on a .Rnw file from TeXstudio, but the unicode characters don't show up in the .tex file when I typeset with xelatex. My user command is /usr/local/bin/Rscript -e "Sweave('%.Rnw'...