search for: ifthenelse

Displaying 11 results from an estimated 11 matches for "ifthenelse".

2012 Apr 04
3
Rgui maintains open file handles after Sweave error
...ean{Sweave at ae} \setboolean{Sweave at ae}{true} \DeclareOption{nogin}{\setboolean{Sweave at gin}{false}} \DeclareOption{noae}{\setboolean{Sweave at ae}{false}} \ProcessOptions \RequirePackage{graphicx,fancyvrb} \IfFileExists{upquote.sty}{\RequirePackage{upquote}}{} \ifthenelse{\boolean{Sweave at gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}% \ifthenelse{\boolean{Sweave at ae}}{% \RequirePackage[T1]{fontenc} \RequirePackage{ae} }{}% \DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} \DefineVerbatimEnvironment{Soutput}{Verbatim}{} \De...
2002 Nov 13
1
Package documentation and rd.sty
Hi all, I've got a basic question regarding package documentation and rd.sty. I wrote my first own package, and now I would like to place the documentation into the appendix of another LaTex document. Seemingly I cannot simply \usepackage{Rd}, as this will modify the page-settings of my document. Is there a minimum style file which will just define the environments and commands needed for
2009 Jul 13
3
SweaveListingUtils question
Hello, recently I read about the SweaveListingUtils package and now I want to try it out. However, I can not make it work... Below a minimal example. The problem seems to be the following line (generated by SweaveListingPreparations()?): \ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.6\textwidth}}{}% If I comment out this line, it works. What can I do about this? I am using the \begin{Scode} notation instead of Rnw files. May this be the problem? For some technical reason, I would like to stick on this notation. Any help appreciat...
2009 Jun 25
1
Setting default plot size in Sweave
...string=plot, eps = FALSE, pdf = TRUE} \SweaveOpts{width=5, height=4} <<fig=T>>= plot(...) @ But the figure still has a width of 80% of the text width, the default set up by Sweave, which issues a LateX command in Sweave.sty of \setkeys{Gin}{.8\textwidth}. Sweave.sty has a command \ifthenelse{\boolean{Sweave at gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}% but I don't know how to set some parameter 'gin' to prevent the setkeys from being executed. I would like to be able to set the default graph dimensions at the start of the document and to only specify height and width...
2009 Jun 26
0
Modifying Sweave.sty to allow escapes with fancyvrb package in LaTeX
...oolean{Sweave at gin} \setboolean{Sweave at gin}{true} \newboolean{Sweave at ae} \setboolean{Sweave at ae}{true} \DeclareOption{nogin}{\setboolean{Sweave at gin}{false}} \DeclareOption{noae}{\setboolean{Sweave at ae}{false}} \ProcessOptions \IfFileExists{upquote.sty}{\RequirePackage{upquote}}{} \ifthenelse{\boolean{Sweave at gin}}{\setkeys{Gin}{width=0.8\textwidth}}{}% \ifthenelse{\boolean{Sweave at ae}}{% \RequirePackage[T1]{fontenc} \RequirePackage{ae} }{}% %\DefineVerbatimEnvironment{Sinput}{Verbatim}{fontshape=sl} \DefineVerbatimEnvironment{Sinput}{Verbatim}{formatcom=\lstset{fancyvrb=true...
2009 Mar 17
1
Combining Sweave and fancyvrb
I find Sweave very useful and I was trying to combine it with the latex package fancyvrb. I was trying to get line numbering and labels in order to reference the lines where particular commands occur. Unfortunately, I haven't been able to figure out how to do it. Maybe somebody can help me. The following is a sample Rnw file: the first part shows what I would like to get, the second what I
2005 May 31
0
Plot Font Size in Sweave
...ddressing this issue from F. Leisch which suggests the solution below. I'm wondering if this is still the best option for this problem or if another solution may exist. Here is how I have resolved the issue based on the prior thread. 1) I modified the original Sweave.sty by commenting out %\ifthenelse{\boolean{Sweave@gin}}{\setkeys{Gin}{width=0.8\textwidth}}{} % I then save this as MySweave.sty and make the appropriate change in the rnw to use this sty instead of Sweave 2) I then set the height and width of each plot inside each code chunk and also use ps() inside each code chunk as well to mo...
2008 Jul 31
0
Is conditional evaluation of R code chunks possible in Sweave ?
...t;<label=methodA>>= R code for method A goes in here more R code @ } if (varible.b == TRUE) { <<label=methodb>>= R code for method B goes in here more R code @ } but the problem under this is the if statement is evaluated *outside* the R code chunk. I know how to use Latex \ifthenelse commands but these only get evaluated during the latex compilation which occurs after the Sweaving... I know Sweave has the eval=TRUE/FALSE option but I don't think this is evaluated in R meaning that one couldn't use an \Sexpr{result = TRUE/FALSE} to set the eval=T/F option for the code c...
2004 Jan 26
5
conditional assignment
Hi all I want to conditionally operate on certain elements of a matrix, let me explain it with a simple vector example > z<- c(1, 2, 3) > zz <- c(0,0,0) > null <- (z > 2) & ( zz <- z) > zz [1] 1 2 3 why zz is not (0, 0, 3) ????? the null <- assignment is to keep the console silent in the other hand, it curious that null has reasonable values > null [1]
2009 Apr 16
2
there are fontencoding problem in Sweave
I want write article by russian language using Sweave. For cyrillic text LaTeX use T2A encoding \usepackage[T2A]{fontenc} But in Sweave.sty we find: \RequirePackage[T1]{fontenc} It is source of critical problem. For example Rnw file $ cat estimation.Rnw \documentclass[A4paper]{article} \usepackage[T2A]{fontenc} \usepackage[utf8]{inputenc} \usepackage[russian,english]{babel}
2012 Mar 25
2
avoiding for loops
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids. I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.frame(group=c("red", "red", "red", "blue",