search for: sinput

Displaying 20 results from an estimated 71 matches for "sinput".

Did you mean: input
2008 Jul 27
2
Colors in Sweave
...weave and was wondering if anyone has had any luck changing the font colors of the code chunks. For instance, in my .Rnw preample I tried including: === \usepackage[usenames]{colors} \definecolor{darkred}{rgb}{0.545,0,0} \definecolor{midnightblue}{rgb}{0.098,0.098,0.439} \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl,formatcom={\color{midnightblue}}} \DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom={\color{darkred}}} \DefineVerbatimEnvironment{Scode}{Verbatim}{fontshape=sl,formatcom={\color{blue}}} === which works in the sense that colors do show up in the processed pdf document,...
2010 Oct 05
3
SweaveInput + keep.source = TRUE trouble
Dear all, I have trouble with R-beta sweaving files that include definitions with \SweaveInput in combination with keep.source = TRUE Symptom: SInput is taken from too far down the input file (the shift is the number of lines of the included file). Is that known? Searching didn't turn up anything, yet I think there are more people than just me using keep.source. Example: $ ~/tmp/R-beta/bin/R CMD Sweave baseline.Rnw && mv baseline.t...
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
2005 Aug 31
1
sinput for Windows
Hi, I'm trying to latex part of my R- code and don't know where to find the sinput package to include in my version of miktex (I have the LINUX version handy, but need also the Windows one) Any idea? (sorry it is not really a R question) Thanks Isotta --------------------------------- [[alternative HTML version deleted]]
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+2 \end...
2012 Aug 21
2
Sweave: R chunk inside caption?
...\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}
2012 Feb 23
1
Sexpr not getting expanded in Sweave
...m verbatim (label = 1) 2 : keep.source term verbatim pdf (label = 2) You can now run (pdf)latex on ‘test.tex’ It works as it should except for \Sexpr \documentclass{article} \title{Sweave minimmal} \author{MK} \usepackage{Sweave} \begin{document} \maketitle We try Sweave: \begin{Schunk} \begin{Sinput} > data(airquality) > summary(airquality) \end{Sinput} \begin{Soutput} Ozone Solar.R Wind Temp Month Day Min. : 1.0 Min. : 7 Min. : 1.70 Min. :56.0 Min. :5.00 Min. : 1.0 1st Qu.: 18.0 1st Qu.:116 1st Qu....
2010 May 13
1
Using Sweave in hostile environments
...tricks to get gradient shading, etc. The problem is that the default environments used by Sweave don't work where I need them. A simple code chunk like <<eval=FALSE>>= x <- 1 @ buried in a minipage within a psshadowbox gives the error Runaway argument? > x <- 1 \end {Sinput} \end {Schunk} and the resulting variable would\ETC. D:/test.tex:302: Paragraph ended before \FV@ BeginScanning was complete Has anyone solved this problem? One way I see that might work is to put the code chunk outside the environment and use SaveVerbatim to save it, then just put \BUseVerbat...
2011 Mar 07
2
Sweave with scan()-ed data
...unexpected numeric constant 42: .828 43: .776 .779 ^ Is there some switch or option for Sweave that will make this work? Below is the slide in question in an executable example: \documentclass[dvipsnames,pdflatex,compress,beamer]{beamer} \usepackage{Sweave} \definecolor{Sinput}{rgb}{1,0,0} \definecolor{Scode}{rgb}{0,0,0.56} \definecolor{Soutput}{rgb}{0,0,1} \DefineVerbatimEnvironment{Sinput}{Verbatim}{formatcom={\color{Sinput}},fontsize=\footnotesize,baselinestretch=0.9} \DefineVerbatimEnvironment{Soutput}{Verbatim}{formatcom={\color{Soutput}},fontsize=\footnotesize,base...
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}
2013 Jan 29
1
Sweave files generating miktex errors
...9;,'b','b','a','c','c','d','a'), l.14 + V1=c('a','b','b','a','c','c','d','a'), \documentclass{article} \usepackage{Sweave} \begin{document} This is a test. \begin{Schunk} \begin{Sinput} > (x <- 1+2) \end{Sinput} \begin{Soutput} [1] 3 \end{Soutput} \begin{Sinput} > test <- data.frame( + V1=c('a','b','b','a','c','c','d','a'), + V27=c('1-oct-2004', '3-jan-2005','4-jan-2005',...
2005 Sep 08
1
Setting width in batch mode
...tate.area), pop=mean(state.pop), hop=mean(state.area)) c(medianarea=median(state.area), medianpop=median(state.pop)) c(medianarea=median(median(state.area)), medianpop=median(state.pop)) @ ---------------------------------------------------------------------- bug.tex \begin{Schunk} \begin{Sinput} > options(width = 55) > data(state) > data.frame(area = mean(state.area), pop = mean(state.pop), + hop = mean(state.area)) \end{Sinput} \begin{Soutput} area pop hop 1 72367.98 4246420 72367.98 \end{Soutput} \begin{Sinput} > c(medianarea = median(state.area), media...
2012 Jan 19
2
Sweave question - Setting Soutput code chunks to stay inside page margins?
...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] "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&quot...
2008 Sep 06
2
Sweave and/or beamer issue
...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, xlab = "...
2004 Sep 06
2
Sweave echoing comments (again)
...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 Aug 04
1
Problem using R and Beamer...
Dear [R] and beamer community, I am trying to build a presentation using beamer and [R]. I can Sweave the file; however, when I run pdflatex on the file i get the following error: ! FancyVerb Error: Extraneous input `> a = 123450 > b = -0.69 \end {Sinput} \end {Schunk} \end { beamer at frameslide}\ifbeamer at twoscreenstext \beamer at dosecondscreennow {{fragile} \frametitle {Numbers} \textbf {Numbers} can be represented in a variety of dif ferent formats. For example the number $1.2345\times 10^5$ is written as 1.234e +05 in \texttt {R}. \begin {...
2004 Sep 06
2
Sweave echoing comments (again)
...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.
2011 Feb 04
1
keep.source when semicolons separate statements on the one line
...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.source=FALSE, the comm...
2010 Dec 14
0
Sweave problem: lines repeated
...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) > m1 <- lm( d...
2008 May 18
1
Figure environment and includegraphics options from Sweave
Tha handy thinb about the fig=TRUE option in Sweave is that you do not have to bother about filenames and starting and stpping the device. I want the the resulting LaTeX to look as: \begin{Schunk} \begin{Sinput} > x <- seq(-2 * pi, 2 * pi, 0.1) > plot(x, cos(x), type = "l", lwd = 4) \end{Sinput} \end{Schunk} \begin{figure} \includegraphics[width=0.6\textwidth]{xx-001} \end{figure} i.e. with options to the \includegraphics and all embedded in a figure environment. 1) Is there a way to...