search for: schunk

Displaying 20 results from an estimated 73 matches for "schunk".

Did you mean: chunk
2004 Mar 12
4
Sweave and R output: possible to suppress "Schunk" tags in *.tex file output?
...ows of a Latex tabular environment with output from R, as in \begin{table} \caption{Table caption.} \label{tab:events} \begin{tabular}{c r r r r r} \hline <<echo=false,results=tex>>= fill.my.table.rows() @ \end{tabular} \end{table} Sweave produces the output inside \begin{Schunk} and \end{Schunk} commands, which latex doesn't tolerate within a table. I would prefer to avoid writing all of the Latex table code from R. Is my only other option to produce a separate text file, e.g. under Sweave with results=hide, then use \input{} on the file? Thanks, Scott Waichler Pac...
2009 Feb 20
1
Sweave schunk placement
...he past few days I have been trying to figure out why the LaTeX endfloat package is not working with Sweave. I figured it out, and it's trivial: The endfloat package requires that \begin{table} and \end{table} commands are on their own line. But Sweave is writing LaTeX code like \end{table}\end{Schunk} which causes endfloat to choke. Simply moving the code down to a new line like this: \end{table} \end{Schunk} fixes the problem, but it is annoying to do this for every table everytime I re-run Sweave. I don't understand LaTeX that well, so I'd be really grateful if someone can tell me ho...
2005 Aug 05
3
Latex error with Sweave example
I created a tex file following the example in the Sweave help which produced the following files in my working directory. Sweave-test-1-006.eps Sweave-test-1-006.pdf Sweave-test-1-007.eps Sweave-test-1-007.pdf Sweave-test-1.tex When I run latex on this, I get a latex error, log file below. I am running R 2.1.1 on Windows XP. I have installed "small MiKTeX" and I have added
2012 Jan 19
2
Sweave question - Setting Soutput code chunks to stay inside page margins?
...make an R code chunk (in Sweave) which is longer then the margins of the page. Is there a way to force it to "go to the next line" (in Sweave) once that happens? Here are two cases this happens in the resulting .tex file (one is a "hard" case, and the other is simpler) \begin{Schunk} \begin{Sinput} > print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") \end{Sinput} \begin{Soutput} [1] "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
2008 Jul 27
2
Colors in Sweave
...h many blank lines. Alternatively, in the resulting tex document I replaced all instances of \begin{Sinput}... \end{Sinput} with {\color{midnightblue}\begin{Sinput} ... \end{Sinput}} and darkred for Soutput and so on. When I do this, I get the following error message: === LaTeX excerpt === \begin{Schunk} {\color{midnightblue}\begin{Sinput} > ISOdatetime(1970, 1, 1, 0, 0, 0, "") - ISOdatetime(1970, 1, 1, + 0, 0, 0, "GMT") \end{Sinput}} {\color{darkred}\begin{Soutput} Time difference of 8 hours \end{Soutput}} \end{Schunk} === === error message === ) ! FancyVerb Error:...
2004 Jan 08
2
Sweave & xtable
...d to me twice in the myfile.dvi. Turning echo off, I get the xtable code (not the nicely formated latex table) back in the dvi. There seems nothing wrong with the myfile.tex file itself. (I attach a snip below). Everything run fine if I manually edit the myfile.tex file and delete the : \begin{Schunk} \begin{Soutput} and, \end{Soutput} \end{Schunk} commands. Dropping these, I get the properly formated latex table in the dvi. I see that others have used xtable, so I assume Sweave.sty handle xtable ok. What am I missing? code and output chunks follow.... ===snip===== n<- xtable(fina...
2012 Aug 21
2
Sweave: R chunk inside caption?
...TeX document: \documentclass{article} \title {test} \author {me} \usepackage{Sweave} \begin {document} \maketitle \DeclareGraphicsExtensions{.pdf,.png} \begin {figure} \includegraphics{test-fig1} \caption { This is the caption with some r-code \begin{Schunk} \begin{Sinput} > 2*2 \end{Sinput} \begin{Soutput} [1] 4 \end{Soutput} \end{Schunk} } \label {fig:1} \end {figure} \end{document}
2005 Jan 02
2
How to quieten axis() for Sweave: avoid echoing NULL?
...R-community, I'm using Sweave to produce reports. The reports require the "axis" command. When I run axis the program returns NULL as well as creating the axis. > plot(1:4, rnorm(4), axes=FALSE) > axis(1, 1:4, LETTERS[1:4]) NULL > So, my Sweave tex files have \begin{Schunk} \begin{Soutput} NULL \end{Soutput} \end{Schunk} in front of each graphic that requires axis. I can easily find them and remove them, but I was wondering: is it something I can avoid? Or am I doing something foolish and obvious? Thanks for any assistance, Andrew -- Andrew Robinson...
2007 Oct 07
5
how to use \Sexpr{} with sweave
I'm trying to learn Sweave. So far things are going well with the chunks of code identified by << >>= But I'm having trouble with the in-line text use of \Sexpr. Here is a short example .Rnw file: \documentclass[12pt]{article} \usepackage[margin=1.25in]{geometry} \usepackage{graphicx} \usepackage{Sweave} \begin{document} <<test>>= pnorm(1) @ \Sexpr{2+6}
2008 Jun 17
3
Sweave: problem with usepackage{C:/PROGRA~1/R/R-27~1.0/share/texmf/Sweave}
...ult-code-mode: R-mode; -*- \documentclass[a4paper]{article} \title{A Test File} \author{Friedrich Leisch} \usepackage{a4wide} \usepackage{C:/PROGRA~1/R/R-27~1.0/share/texmf/Sweave} \begin{document} \maketitle A simple example that will run in any S engine: The integers from 1 to 10 are \begin{Schunk} \begin{Soutput} [1] 1 2 3 4 5 6 7 8 9 10 \end{Soutput} \end{Schunk} We can also emulate a simple calculator: ?etc. ---------------------------------------------------------- When I run this file Latex ? Pdf using MikTeX 2.7 and TeXnicCenter I get an error message. I know that it has so...
2010 Dec 22
1
Error in generating sweave-tex -> pdf file
...rt tex file generated from it into pdf, I get error message as follows: > texi2dvi("test.tex", pdf=TRUE) Error in texi2dvi("test.tex", pdf = TRUE) : Running 'texi2dvi' on 'test.tex' failed. LaTeX errors: ! Undefined control sequence. l.8 \begin {Schunk} ? ! Interruption. ! Interruption. <to be read again> { l.8 \begin{ Schunk} ! Undefined control sequence. l.9 \begin {Sinput} The control sequence at the end of the top line of your error message was never \def'ed. If you have --------------------...
2010 Oct 05
3
SweaveInput + keep.source = TRUE trouble
...e.Rnw && mv baseline.tex baseline.2.11.tex && diff -u baseline.2.11.tex baseline.devel.tex gives: --- baseline.2.11.tex 2010-10-05 11:33:49.000000000 +0200 +++ baseline.devel.tex 2010-10-05 11:33:49.000000000 +0200 @@ -83,7 +83,7 @@ \verb+\SweaveOpts{keep.source = TRUE}+ \begin{Schunk} \begin{Sinput} -> 12 +> line 54 \end{Sinput} \begin{Soutput} [1] 12 @@ -106,7 +106,7 @@ line 63 chunk option keep.source = TRUE \begin{Schunk} \begin{Sinput} -> 14 +> line 67 \end{Sinput} \begin{Soutput} [1] 14 I used yesterday's R-beta, and my system is Ubuntu...
2008 Sep 06
2
Sweave and/or beamer issue
Dear Friends, I not sure whether this is an Sweave or a beamer problem. The Rnw file: \documentclass[compress,smaller]{beamer} %\documentclass{article} %\usepackage{beamerarticle} \usepackage{Sweave} \title{Psychophysics II} \date{September 9, 2008} \begin{document} \frame{ \begin{Schunk} \begin{Sinput} > ro <- 0.2 > c <- seq(from = -3, to = 4, by = 0.1) > fn <- 1 - pnorm(c) > fo <- 1 - pnorm(c, mean = 1) > h <- fo + ro - ro * fo > f <- fn > plot(h ~ f, type = "l", asp = 1, xlim = c(0.01, 1.01), ylim = c(0.01, 1.01), las = 1...
2004 Sep 06
2
Sweave echoing comments (again)
Hello, I try to document some R scripts for my collegues and observed the problem, that Sweave strips comment lines away. As a small example I write in an Rtex file: \begin{Scode} ## a small example test() # line comment \end{Scode} ... the .tex file generated by Sweave only contains: \begin{Schunk} \begin{Sinput} test() \end{Sinput} \end{Schunk} ... and all the comments are lost. Looking into the archives, I found, that such a question appeared already some months ago. Are there any advances or workarounds doing such things today? Thank you in advance! Thomas P.
2004 Sep 06
2
Sweave echoing comments (again)
Hello, I try to document some R scripts for my collegues and observed the problem, that Sweave strips comment lines away. As a small example I write in an Rtex file: \begin{Scode} ## a small example test() # line comment \end{Scode} ... the .tex file generated by Sweave only contains: \begin{Schunk} \begin{Sinput} test() \end{Sinput} \end{Schunk} ... and all the comments are lost. Looking into the archives, I found, that such a question appeared already some months ago. Are there any advances or workarounds doing such things today? Thank you in advance! Thomas P.
2010 Sep 11
0
Sweave issue; keep.source=TRUE and cacheSweave incompatible?
...author of the relevant package is CC'd in any event. I'm seeing some odd behavior from Sweave with keep.source=TRUE when using driver=cacheSweaveDriver from the cacheSweave package. It would seem that code chunks with keep.source=TRUE aren't being parsed correctly; the corresponding Schunk starts at the *very top* of the Rnw file, snippet shown below. The error seems specific to R 2.12.0; cacheSweave + keep.source=TRUE seems to work ok in R 2.11. Many thanks — Simon Version details: R version 2.12.0 Under development (unstable) (2010-09-10 r52888) cacheSweave package 0.4-4 Swe...
2011 Feb 04
1
keep.source when semicolons separate statements on the one line
...> library(SMIR); data(bronchit); library(KernSmooth) > @ % > > Code for panel A is > <<code-xycig-A, eval=f, echo=t>>= > <<xycig-A>> > @ % Sweave("semicolon") yields the following 'semicolon.tex' > Code for panel A is > \begin{Schunk} > \begin{Sinput} >> library(SMIR); data(bronchit); library(KernSmooth) >> library(SMIR); data(bronchit); library(KernSmooth) >> library(SMIR); data(bronchit); library(KernSmooth) > \end{Sinput} > \end{Schunk} (I have omitted three blank lines at the start) With keep.so...
2013 Feb 09
1
Swaeve, Beamer and \alt
Hi, I am having trouble getting \alt (or \altenv) to work with Schunk/Sinput and was wondering if anybody had had success? With the slide \begin{frame}[fragile]\frametitle{Basic R} \alt<2>{ <<echo=TRUE>>= 2+2 @ }{ <<echo=TRUE, eval=FALSE>>= 2+2 @ } \end{frame} I get the error message: ! FancyVerb Error: Extraneous input `> 2+...
2010 Dec 14
0
Sweave problem: lines repeated
...sults=hide,fig=FALSE,keep.source=TRUE>>= data(cars) m1 <- lm( dist~speed, data=cars ) @ <<echo=TRUE,results=verbatim,fig=FALSE,keep.source=TRUE>>= <<TESTME2>> @ After running Sweave over this file in R, the output file (eg. test.tex) looks like this: \begin{Schunk} \begin{Sinput} > data(cars) > m1 <- lm( dist~speed, data=cars ); coef( m1 ) > m1 <- lm( dist~speed, data=cars ); coef( m1 ) \end{Sinput} \begin{Soutput} (Intercept) speed -17.579095 3.932409 \end{Soutput} \end{Schunk} \begin{Schunk} \begin{Sinput} > data(cars) >...
2009 Apr 19
2
Sweave: Changing the background color, adding a border
...a document. Unfortunately, I have to print several copies and I can't print them in color. So I would like to change the way of printing the code. I would like to print the code in a box with a black borderline and a grey background (quite classic). Is it possible to do it by changing some Schunk options? Christophe