[Distr-commits] r504 - branches/distr-2.2/pkg/SweaveListingUtils branches/distr-2.2/pkg/SweaveListingUtils/R branches/distr-2.2/pkg/SweaveListingUtils/chm branches/distr-2.2/pkg/SweaveListingUtils/inst branches/distr-2.2/pkg/SweaveListingUtils/man branches/distr-2.2/pkg/distr/chm branches/distr-2.2/pkg/distr/inst/doc branches/distr-2.2/pkg/distrDoc/chm branches/distr-2.2/pkg/distrEllipse/chm branches/distr-2.2/pkg/distrEx/chm branches/distr-2.2/pkg/distrEx/src branches/distr-2.2/pkg/distrMod/chm branches/distr-2.2/pkg/distrSim/chm branches/distr-2.2/pkg/distrTEst/chm branches/distr-2.2/pkg/distrTeach/chm branches/distr-2.2/pkg/startupmsg/chm pkg/SweaveListingUtils pkg/SweaveListingUtils/R pkg/SweaveListingUtils/chm pkg/SweaveListingUtils/inst pkg/SweaveListingUtils/man pkg/distr/chm pkg/startupmsg/chm

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 7 23:41:19 CEST 2009


Author: ruckdeschel
Date: 2009-07-07 23:41:19 +0200 (Tue, 07 Jul 2009)
New Revision: 504

Added:
   branches/distr-2.2/pkg/SweaveListingUtils/man/isBaseOrRecommended.Rd
   branches/distr-2.2/pkg/SweaveListingUtils/man/setBaseOrRecommended.Rd
   pkg/SweaveListingUtils/man/isBaseOrRecommended.Rd
   pkg/SweaveListingUtils/man/setBaseOrRecommended.Rd
Modified:
   branches/distr-2.2/pkg/SweaveListingUtils/NAMESPACE
   branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R
   branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingUtils.R
   branches/distr-2.2/pkg/SweaveListingUtils/R/keywordsStyle.R
   branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingPreparations.html
   branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingUtils.chm
   branches/distr-2.2/pkg/SweaveListingUtils/inst/NEWS
   branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingOptions.Rd
   branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingPreparations.Rd
   branches/distr-2.2/pkg/SweaveListingUtils/man/lstset.Rd
   branches/distr-2.2/pkg/distr/chm/Distr.chm
   branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf
   branches/distr-2.2/pkg/distr/inst/doc/newDistributions.pdf
   branches/distr-2.2/pkg/distrDoc/chm/distrDoc.chm
   branches/distr-2.2/pkg/distrEllipse/chm/00Index.html
   branches/distr-2.2/pkg/distrEllipse/chm/distrEllipse.chm
   branches/distr-2.2/pkg/distrEx/chm/distrEx.chm
   branches/distr-2.2/pkg/distrEx/src/distrEx.dll
   branches/distr-2.2/pkg/distrMod/chm/distrMod.chm
   branches/distr-2.2/pkg/distrSim/chm/distrSim.chm
   branches/distr-2.2/pkg/distrTEst/chm/distrTEst.chm
   branches/distr-2.2/pkg/distrTeach/chm/distrTeach.chm
   branches/distr-2.2/pkg/startupmsg/chm/startupmsg.chm
   pkg/SweaveListingUtils/DESCRIPTION
   pkg/SweaveListingUtils/NAMESPACE
   pkg/SweaveListingUtils/R/SweaveListingOptions.R
   pkg/SweaveListingUtils/R/SweaveListingUtils.R
   pkg/SweaveListingUtils/R/keywordsStyle.R
   pkg/SweaveListingUtils/chm/00Index.html
   pkg/SweaveListingUtils/chm/SweaveListingOptions.html
   pkg/SweaveListingUtils/chm/SweaveListingPreparations.html
   pkg/SweaveListingUtils/chm/SweaveListingUtils.chm
   pkg/SweaveListingUtils/chm/SweaveListingUtils.hhp
   pkg/SweaveListingUtils/chm/SweaveListingUtils.toc
   pkg/SweaveListingUtils/chm/lstset.html
   pkg/SweaveListingUtils/inst/NEWS
   pkg/SweaveListingUtils/man/SweaveListingOptions.Rd
   pkg/SweaveListingUtils/man/SweaveListingPreparations.Rd
   pkg/SweaveListingUtils/man/lstset.Rd
   pkg/distr/chm/Distr.chm
   pkg/startupmsg/chm/startupmsg.chm
Log:
some enhancements in SweaveListingUtils:
* when SweaveListingPreparations is used with argument 'withOwnFileSection'=TRUE
  lstsetR and lstsetRd use argument 'add' = FALSE by default
* markup style for base or recommended packages (checked for with new function
  isBaseOrRecommended()) is distinct now by default (extra color RRecomdcolor)


Modified: branches/distr-2.2/pkg/SweaveListingUtils/NAMESPACE
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/NAMESPACE	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/NAMESPACE	2009-07-07 21:41:19 UTC (rev 504)
@@ -5,5 +5,6 @@
        "readPkgVersion",  "SweaveListingOptions",
        "SweaveListingoptions", "getSweaveListingOption",
        "SweaveListingMASK", "setToBeDefinedPkgs","lstsetLanguage",
-       "changeKeywordstyles", "library", "require")
+       "changeKeywordstyles", "library", "require", 
+       "isBaseOrRecommended", "setBaseOrRecommended")
 S3method(print, taglist)
\ No newline at end of file

Modified: branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-07-07 21:41:19 UTC (rev 504)
@@ -24,6 +24,7 @@
                "commentstyle" = "{\\ttfamily\\itshape}",
                "alsolanguage" = "R"),
 Rcolor  = c(0,0.5,0.5),
+RRecomdcolor  = c(0,0.6,0.4),
 Rbcolor  = c(0,0.6,0.6),
 Rout     = c(0.461,0.039,0.102),
 Rcomment = c(0.101,0.043,0.432),
@@ -36,7 +37,9 @@
 inSweave = FALSE,
 fromRForge = TRUE,
 base.url = paste("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/",
-                            "*checkout*/pkg/", sep = "")
+                            "*checkout*/pkg/", sep = ""),
+addRset = TRUE,
+addRdset = TRUE
 )
 
 SweaveListingOptions <- function(...) {

Modified: branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingUtils.R
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingUtils.R	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/R/SweaveListingUtils.R	2009-07-07 21:41:19 UTC (rev 504)
@@ -107,7 +107,8 @@
    return(invisible())
 }
 
-lstsetR <- function(Rset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{"){
+lstsetR <- function(Rset = NULL, LineLength = 80,
+                    add = getSweaveListingOption("addRset"), startS = "\\lstset{"){
    if(add){
        Rset0 <- getSweaveListingOption("Rset")
        if(length(Rset)){
@@ -122,7 +123,8 @@
    return(invisible())
 }
 
-lstsetRd <- function(Rdset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{"){
+lstsetRd <- function(Rdset = NULL, LineLength = 80,
+                    add = getSweaveListingOption("addRdset"), startS = "\\lstset{"){
    if(add){
        Rdset0 <- getSweaveListingOption("Rdset")
        if(length(Rdset)){
@@ -141,14 +143,14 @@
 SweaveListingPreparations <- function(
    withOwnFileSection = FALSE,
    withVerbatim = FALSE,
-   withSchunkDef = TRUE,
    gin = TRUE,
    ae = TRUE,
    LineLength = 80,
    Rset = getSweaveListingOption("Rset"), 
    Rdset = getSweaveListingOption("Rdset"), 
    Rcolor = getSweaveListingOption("Rcolor"), 
-   Rbcolor = getSweaveListingOption("Rbcolor"), 
+   RRecomdcolor = getSweaveListingOption("RRecomdcolor"),
+   Rbcolor = getSweaveListingOption("Rbcolor"),
    Rout = getSweaveListingOption("Rout"),
    Rcomment = getSweaveListingOption("Rcomment"), 
    pkg = getSweaveListingOption("pkg"), 
@@ -157,13 +159,13 @@
 
 sws <- .SweaveListingOptions
 sws$inSweave <- TRUE
+assignInNamespace(".SweaveListingOptions", sws, "SweaveListingUtils")
+
 withVerbatim <- rep(withVerbatim, length.out=3)
-
 if(is.null(names(withVerbatim)))
    names(withVerbatim) <- c("Sinput", "Soutput", "Scode")
 
 
-assignInNamespace(".SweaveListingOptions", sws, "SweaveListingUtils")
 line <- paste("%",paste(rep("-",LineLength-2),collapse=""),"%\n", sep="")
 
 
@@ -173,6 +175,7 @@
 
 cat("\\RequirePackage{color}\n")
 cat("\\definecolor{Rcolor}{rgb}{",paste(Rcolor,collapse=", "),"}\n", sep = "")
+cat("\\definecolor{RRecomdcolor}{rgb}{",paste(RRecomdcolor,collapse=", "),"}\n", sep = "")
 cat("\\definecolor{Rbcolor}{rgb}{",paste(Rbcolor,collapse=", "),"}\n", sep = "")
 cat("\\definecolor{Rout}{rgb}{",paste(Rout,collapse=", "),"}\n", sep = "")
 cat("\\definecolor{Rcomment}{rgb}{",paste(Rcomment,collapse=", "),"}\n", sep = "")
@@ -184,9 +187,12 @@
 lstsetR(Rset=Rset, LineLength=LineLength, startS ="\\lstdefinestyle{Rstyle}{")
 lstsetRd(Rdset=Rdset, LineLength=LineLength, startS ="\\lstdefinestyle{Rdstyle}{")
 cat(line)
+if(!withOwnFileSection)
+    SweaveListingoptions("addRset" = FALSE, "addRdset" = FALSE)
 cat("\\global\\def\\Rlstset{\\lstset{style=Rstyle}}%\n")
 cat("\\global\\def\\Rdlstset{\\lstset{style=Rdstyle}}%\n")
-cat("\\Rlstset\n")
+if(!withOwnFileSection)
+   cat("\\Rlstset\n")
 cat(line,"%copying relevant parts of Sweave.sty\n",line,"%\n", sep = "")
 
 cat("\\RequirePackage{ifthen}%\n")
@@ -209,8 +215,7 @@
     "\\RequirePackage[T1]{fontenc}\n",
     "\\RequirePackage{ae}\n}{}%\n", sep ="")
 
-if(withSchunkDef)
-   cat("\\newenvironment{Schunk}{}{}\n\n")
+cat("\\newenvironment{Schunk}{}{}\n\n")
 
 cat("\\newcommand{\\Sconcordance}[1]{% \n",
   "\\ifx\\pdfoutput\\undefined% \n",
@@ -226,8 +231,10 @@
 }else{
 #### Thanks to Andrew Ellis !!
 cat("\\lstnewenvironment{Sinput}")
-cat("%\n  {\\Rlstset\\lstset{basicstyle=\\color{Rcolor}\\small,fancyvrb=true}}")
-cat("%\n  {\\Rlstset}\n")
+cat("%\n  {", # "\\Rlstset",
+           "\\Rlstset\\lstset{basicstyle=\\color{Rcolor}\\small,fancyvrb=true}}")
+cat("%\n  {", # "\\Rlstset",
+           "}\n")
 }
 if(withVerbatim["Soutput"]){
 cat("\\DefineVerbatimEnvironment{Soutput}{Verbatim}")
@@ -235,8 +242,10 @@
 }else{
 #### Thanks to Andrew Ellis !!
 cat("\\lstnewenvironment{Soutput}")
-cat("%\n  {\\Rlstset\\lstset{fancyvrb=false,basicstyle=\\color{Rout}\\small}}")
-cat("%\n  {\\Rlstset}\n")
+cat("%\n  {", # "\\Rlstset",
+           "\\lstset{fancyvrb=false,basicstyle=\\color{Rout}\\small}}")
+cat("%\n  {", # "\\Rlstset",
+           "}\n")
 }
 if(withVerbatim["Scode"]){
 cat("\\DefineVerbatimEnvironment{Scode}{Verbatim}")
@@ -244,8 +253,10 @@
 }else{
 #### Thanks to Andrew Ellis !!
 cat("\\lstnewenvironment{Scode}")
-cat("%\n  {\\Rlstset\\lstset{fontshape=sl,basicstyle=\\color{Rcolor}\\small,fancyvrb=true}}")
-cat("%\n  {\\Rlstset}\n")
+cat("%\n  {", # "\\Rlstset",
+           "\\lstset{fontshape=sl,basicstyle=\\color{Rcolor}\\small,fancyvrb=true}}")
+cat("%\n  {", # "\\Rlstset",
+           "}\n")
 }
 }
 cat(line)

Modified: branches/distr-2.2/pkg/SweaveListingUtils/R/keywordsStyle.R
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/R/keywordsStyle.R	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/R/keywordsStyle.R	2009-07-07 21:41:19 UTC (rev 504)
@@ -22,11 +22,19 @@
       idx <- seq(along = pkgs)
       idxIn <- idx[pkgs %in% .tobeDefinedPkgs[,1]]
       idxNIn <- idx[!(pkgs %in% .tobeDefinedPkgs[,1])]
-      if(missing(defkws))
-        defkws <- getSweaveListingOption("Keywordstyle")
-      defkws <- rep(defkws, length.out = length(idxNIn))
-      if(length(idxIn)) kws[idxIn] <- .tobeDefinedPkgs[.tobeDefinedPkgs[,1] %in% pkgs[idxIn] ,2]
-      if(length(idxNIn)) kws[idxNIn] <- defkws
+      idxRec <- NULL
+      if(length(idxNIn)){
+        if(missing(defkws))
+           defkwsI <- setBaseOrRecommended(pkgs = pkgs[idxNIn])
+        else{
+           defkwsI <- if(length(idxNIn)) defkws[idxNIn] else defkws
+           defkwsI <- rep(defkwsI, length.out = length(idxNIn))
+           defkwsI <- setBaseOrRecommended(pkgs = pkgs[idxNIn], kws = defkwsI)
+        }
+        kws[idxNIn] <- defkwsI
+      }
+      if(length(idxIn))
+         kws[idxIn] <- .tobeDefinedPkgs[.tobeDefinedPkgs[,1] %in% pkgs[idxIn] ,2]
       return(kws)
     }
 }
@@ -36,7 +44,12 @@
         if (!overwrite)
              kwd <- kwd[!kwd%in%.keywordsR]
         num <- length(.alreadyDefinedPkgs)
+        BaseOrRec <- ""
+        if(!is.na(isBaseOrRecommended(pkg)))
+            if(isBaseOrRecommended(pkg))
+               BaseOrRec <- " [recommended or base] "
         cat("% --------------------------\n% Registration of package ",pkg,
+             BaseOrRec,
             "\n% --------------------------\n",
             "\\lstset{morekeywords={[",num+2,"]", sep = "")
         ml <- length(kwd); m1 <- ml%/%5; m2 <- ml%%5
@@ -75,10 +88,14 @@
      }
      pkgs <- .packages()[posIdx]
      lP <- length(posIdx)
-     if(missing(keywordstyles))
+     if(missing(keywordstyles)){
         keywordstyles <- getSweaveListingOption("Keywordstyle")
-     keywordstyles <- rep(keywordstyles, length.out = lP)
-#     print(lP); print(pkgs); print(posIdx); print(search())
+        keywordstyles <- rep(keywordstyles, length.out = lP)
+        keywordstyles <- setBaseOrRecommended(pkgs = pkgs,
+                                              kws = keywordstyles)
+     }else
+        keywordstyles <- rep(keywordstyles, length.out = lP)
+
      if(lP) {for(i in 1: lP){
         kwl <- ls(pos = which(pkgs[i] == gsub("package:","",search())))
         kwl <- sort(kwl[grep("^[[:alpha:]]+\\w*",kwl,perl=TRUE)],
@@ -173,19 +190,21 @@
                 pint <- pdiff[!pdiff == pkg]
 #
                 if(is.null(interm.keywordstyles) && length(pint))
-                   interm.keywordstyles <- lookUpKeywordStyles(pkgs = pint,
+                    interm.keywordstyles <- lookUpKeywordStyles(pkgs = pint,
                                      defkws = getSweaveListingOption("interm.Keywordstyle"))
                 if(is.null(keywordstyles))
-                   keywordstyles <- lookUpKeywordStyles(pkgs = pkg,
+                    keywordstyles <- lookUpKeywordStyles(pkgs = pkg,
                                      defkws = getSweaveListingOption("Keywordstyle"))
 
                 if(intermediate){
                    pkgs <- c(pkg, pint)
                    kws.int <- rep(interm.keywordstyles,length.out= length(pint))
-                   kws <- c(keywordstyles[1],kws.int)
+                   kws.o <- rep(keywordstyles,length.out= length(pkg))
+                   kws <- c(kws.o,kws.int)
                 }else{
                    pkgs <- pkg
-                   kws <- keywordstyles[1]
+                   kws.o <- rep(keywordstyles,length.out= length(pkg))
+                   kws <- kws.o
                 }
                 if(is.null(mc$help)&&!is.null(pkg))
                 lstsetLanguage(pkgs = pkgs, keywordstyles = kws,
@@ -195,3 +214,34 @@
              }
              return(rerg)
 }
+
+isBaseOrRecommended <- function(pkgs){
+   sapply(pkgs, function(x){
+      logres <- read.dcf(file = system.file("DESCRIPTION", package = x),
+                         fields="Priority") %in% c("base","recommended")
+      logres[is.na(logres)] <- FALSE
+      any(logres)
+
+   })
+}
+
+
+setBaseOrRecommended <- function(pkgs,kws){
+      idxRec <- as.logical(isBaseOrRecommended(pkgs = pkgs))
+      if(missing(kws))
+         kws <- rep(getSweaveListingOption("Keywordstyle"),
+                    length.out = length(pkgs))
+      else
+         kws <- rep(kws, length.out = length(pkgs))
+
+      if(any(idxRec)){
+        kwsI <- kws[idxRec]
+
+        grI <- grep("\\\\color\\{.+\\}", kwsI, invert = TRUE)
+        kwsI <- gsub("\\\\color\\{.+\\}","\\\\color\\{RRecomdcolor\\}",
+                           kwsI)
+        kwsI[grI] <- gsub("\\}$","\\\\color\\{RRecomdcolor\\}\\}",kwsI[grI])
+        kws[idxRec] <- kwsI
+      }
+      return(kws)
+}

Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingPreparations.html
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingPreparations.html	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingPreparations.html	2009-07-07 21:41:19 UTC (rev 504)
@@ -43,6 +43,79 @@
 </pre>
 
 
+<h3>Arguments</h3>
+
+<table summary="R argblock">
+<tr valign="top"><td><code>withOwnFileSection</code></td>
+<td>
+logical: Does one want to use an own definition file/
+section to define <code>Sinput</code>, <code>Soutput</code>,
+<code>Scode</code> environments; if <code>TRUE</code> you should write some
+<KBD>\include</KBD> directive to include your own
+definitions / or write them in your &lsquo;<span class="file">.Rnw</span>&rsquo; file.
+</td></tr>
+<tr valign="top"><td><code>withVerbatim</code></td>
+<td>
+logical of length 3 (filled by recycling if of shorter length)
+either named ("Sinput", "Soutput", "Scode") or taken in
+order (Sinput, Soutput, Scode):
+Should we use Verbatim from TeX package 'fancyvrb'
+(i.e. the original
+<KBD>"\DefineVerbatimEnvironment{Sinput}{Verbatim}"</KBD> by
+Fritz Leisch) or just TeX package 'listings'
+(i.e. we define our own <code>Sinput</code> environment
+based on 'listings' command 'lstnewenvironment';
+this option is due to a suggestion by
+Andrew Ellis (thank you!).</td></tr>
+<tr valign="top"><td><code>withSchunkDef</code></td>
+<td>
+logical: should environment <code>Schunk</code> be defined?</td></tr>
+<tr valign="top"><td><code>gin</code></td>
+<td>
+logical: shall we use <code>gin</code></td></tr>
+<tr valign="top"><td><code>ae</code></td>
+<td>
+logical: shall we use <code>ae</code></td></tr>
+<tr valign="top"><td><code>LineLength</code></td>
+<td>
+numeric; defaults to 80</td></tr>
+<tr valign="top"><td><code>Rset</code></td>
+<td>
+list or taglist; defaults to global option  <code>"Rset"</code></td></tr>
+<tr valign="top"><td><code>Rdset</code></td>
+<td>
+list or taglist; defaults to global option  <code>"Rdset"</code></td></tr>
+<tr valign="top"><td><code>Rcolor</code></td>
+<td>
+numeric of length 3; defaults to global option  <code>"Rcolor"</code>;
+rgb coordinates of the color in which to print R-code</td></tr>
+<tr valign="top"><td><code>Rbcolor</code></td>
+<td>
+numeric of length 3; defaults to global option  <code>"Rbcolor"</code>;
+rgb coordinates of the color in which to print <font face="Courier New,Courier" color="#666666"><b>R</b></font> keywords
+induced by intermediate packages.</td></tr>
+<tr valign="top"><td><code>Rout</code></td>
+<td>
+numeric of length 3; defaults to global option  <code>"Rout"</code>;
+rgb coordinates of the color in which to print R output</td></tr>
+<tr valign="top"><td><code>Rcomment</code></td>
+<td>
+numeric of length 3; defaults to global option <code>"Rcomment"</code>;
+rgb coordinates of the color in which to print comments
+in R-code</td></tr>
+<tr valign="top"><td><code>pkg</code></td>
+<td>
+character; name of the packageto be described (e.g. in a vignette);
+defaults to global option <code>"pkg"</code></td></tr>
+<tr valign="top"><td><code>pkv</code></td>
+<td>
+character; package version to be described (e.g. in a vignette);
+defaults to global option <code>"pkv"</code></td></tr>
+<tr valign="top"><td><code>lib.loc</code></td>
+<td>
+location of a local library in which the described package resides</td></tr>
+</table>
+
 <h3>Details</h3>
 
 <p>

Modified: branches/distr-2.2/pkg/SweaveListingUtils/chm/SweaveListingUtils.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/SweaveListingUtils/inst/NEWS
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/inst/NEWS	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/inst/NEWS	2009-07-07 21:41:19 UTC (rev 504)
@@ -3,6 +3,14 @@
 ######################################################################
  
 ##############
+v 0.3.1
+##############
+* when SweaveListingPreparations is used with argument 'withOwnFileSection'=TRUE
+  lstsetR and lstsetRd use argument 'add' = FALSE by default
+* markup style for base or recommended packages (checked for with new function
+  isBaseOrRecommended()) is distinct now by default (extra color RRecomdcolor)
+
+##############
 v 0.3
 ##############
 

Modified: branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingOptions.Rd
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingOptions.Rd	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingOptions.Rd	2009-07-07 21:41:19 UTC (rev 504)
@@ -17,6 +17,8 @@
 \alias{inSweave}
 \alias{fromRForge}
 \alias{base.url}
+\alias{addRset}
+\alias{addRdset}
 
 \title{Function to change the global options of the package `SweaveListingUtils' }
 \description{With \code{SweaveListingOptions} you can inspect and change 
@@ -96,6 +98,10 @@
             "http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/"
             }
 
+\item{addRset:}{logical; default for argument \code{add} in command \code{Rset};
+        defaults to \code{TRUE}}
+\item{addRdset:}{logical; default for argument \code{add} in command \code{Rdset};
+        defaults to \code{TRUE}}
 }
 }
 %\references{}

Modified: branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingPreparations.Rd
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingPreparations.Rd	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/man/SweaveListingPreparations.Rd	2009-07-07 21:41:19 UTC (rev 504)
@@ -9,14 +9,14 @@
 SweaveListingPreparations(
    withOwnFileSection = FALSE,  % suggestion by Andrew Ellis!
    withVerbatim = FALSE, % suggestion by Andrew Ellis!
-   withSchunkDef = TRUE, % needed in some papers
    gin = TRUE,
    ae = TRUE,
    LineLength = 80,
    Rset = getSweaveListingOption("Rset"),
    Rdset = getSweaveListingOption("Rdset"),
    Rcolor = getSweaveListingOption("Rcolor"),
-   Rbcolor = getSweaveListingOption("Rbcolor"), 
+   RRecomdcolor = getSweaveListingOption("RRecomdcolor"),
+   Rbcolor = getSweaveListingOption("Rbcolor"),
    Rout = getSweaveListingOption("Rout"),
    Rcomment = getSweaveListingOption("Rcomment"),
    pkg = getSweaveListingOption("pkg"),
@@ -41,20 +41,22 @@
                        based on 'listings' command 'lstnewenvironment';
                        this option is due to a suggestion by
                        Andrew Ellis (thank you!).}
-  \item{withSchunkDef}{logical: should environment \code{Schunk} be defined?}
   \item{gin}{logical: shall we use \code{gin}}
   \item{ae}{logical: shall we use \code{ae}}
   \item{LineLength}{numeric; defaults to 80}
   \item{Rset}{list or taglist; defaults to global option  \code{"Rset"}}
   \item{Rdset}{list or taglist; defaults to global option  \code{"Rdset"}}
-  \item{Rcolor}{numeric of length 3; defaults to global option  \code{"Rcolor"};
+  \item{Rcolor}{numeric of length 3; [color for R-input-code] defaults to global option  \code{"Rcolor"};
                 rgb coordinates of the color in which to print R-code}
-  \item{Rbcolor}{numeric of length 3; defaults to global option  \code{"Rbcolor"};
+  \item{RRecomdcolor}{numeric of length 3; [color for R-symbols from recommended packages]
+                defaults to global option  \code{"RRecomdcolor"};
+                rgb coordinates of the color in which to print R-code}
+  \item{Rbcolor}{numeric of length 3; [color for R-symbols from intermediate packages] defaults to global option  \code{"Rbcolor"};
                  rgb coordinates of the color in which to print \R keywords
                  induced by intermediate packages.}
-  \item{Rout}{numeric of length 3; defaults to global option  \code{"Rout"};
+  \item{Rout}{numeric of length 3; [color for R-output-code] defaults to global option  \code{"Rout"};
                 rgb coordinates of the color in which to print R output}
-  \item{Rcomment}{numeric of length 3; defaults to global option \code{"Rcomment"};
+  \item{Rcomment}{numeric of length 3; [color for R-comments] defaults to global option \code{"Rcomment"};
                 rgb coordinates of the color in which to print comments
                 in R-code}
   \item{pkg}{character; name of the packageto be described (e.g. in a vignette);

Added: branches/distr-2.2/pkg/SweaveListingUtils/man/isBaseOrRecommended.Rd
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/man/isBaseOrRecommended.Rd	                        (rev 0)
+++ branches/distr-2.2/pkg/SweaveListingUtils/man/isBaseOrRecommended.Rd	2009-07-07 21:41:19 UTC (rev 504)
@@ -0,0 +1,29 @@
+\name{isBaseOrRecommended}
+\alias{isBaseOrRecommended}
+\title{isBaseOrRecommended}
+\description{
+finds out whether a package is of priority \code{base} and \code{recommended}.}
+
+\usage{
+isBaseOrRecommended(pkgs)
+}
+
+\arguments{
+  \item{pkgs}{character; the packages for which we want to find out if
+              it is of priority \code{base} and \code{recommended}.}
+}
+
+\value{
+ a logical of the same length as the input
+}
+
+\details{
+reads out the \file{DESCRIPTION} files of the packages to
+get the information.
+}
+
+\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
+\examples{
+isBaseOrRecommended(pkgs = c("SweaveListingUtils","Matrix","splines"))}
+\keyword{utilities}
+\keyword{internal}
\ No newline at end of file

Modified: branches/distr-2.2/pkg/SweaveListingUtils/man/lstset.Rd
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/man/lstset.Rd	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/SweaveListingUtils/man/lstset.Rd	2009-07-07 21:41:19 UTC (rev 504)
@@ -8,8 +8,10 @@
 Functions for defining how listings prints R and Rd source code}
 \usage{
 lstset(taglist, LineLength = 80, startS = "\\\\lstset\{")
-lstsetR(Rset = NULL, LineLength = 80, add = TRUE, startS = "\\\\lstset\{")
-lstsetRd(Rdset = NULL, LineLength = 80, add = TRUE, startS = "\\\\lstset\{")
+lstsetR(Rset = NULL, LineLength = 80, add = getSweaveListingOption("addRset"),
+        startS = "\\\\lstset\{")
+lstsetRd(Rdset = NULL, LineLength = 80, add = getSweaveListingOption("addRdset"),
+         startS = "\\\\lstset\{")
 }
 
 \arguments{

Added: branches/distr-2.2/pkg/SweaveListingUtils/man/setBaseOrRecommended.Rd
===================================================================
--- branches/distr-2.2/pkg/SweaveListingUtils/man/setBaseOrRecommended.Rd	                        (rev 0)
+++ branches/distr-2.2/pkg/SweaveListingUtils/man/setBaseOrRecommended.Rd	2009-07-07 21:41:19 UTC (rev 504)
@@ -0,0 +1,24 @@
+\name{setBaseOrRecommended}
+\alias{setBaseOrRecommended}
+\title{setBaseOrRecommended}
+\description{
+modifies the color settings in keywordstyles of base and recommended packages.}
+
+\usage{
+setBaseOrRecommended(pkgs,kws)
+}
+
+\arguments{
+  \item{pkgs}{character; the packages for which we want to find out if
+              it is of priority \code{base} and \code{recommended}.}
+  \item{kws}{character; the keywordstyles for the packages to be modified.}
+}
+
+\value{
+ the modified keywordstyle vector.
+}
+
+
+\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
+\keyword{utilities}
+\keyword{internal}
\ No newline at end of file

Modified: branches/distr-2.2/pkg/distr/chm/Distr.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf
===================================================================
--- branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/distr/inst/doc/Rplots.pdf	2009-07-07 21:41:19 UTC (rev 504)
@@ -2,8 +2,8 @@
 %âãÏÓ\r
 1 0 obj
 <<
-/CreationDate (D:20090703072009)
-/ModDate (D:20090703072009)
+/CreationDate (D:20090703232757)
+/ModDate (D:20090703232757)
 /Title (R Graphics Output)
 /Producer (R 2.10.0)
 /Creator (R)
@@ -169,7 +169,7 @@
 54.43 64.20 l
 54.53 64.21 l
 54.63 64.22 l
-54.73 64.24 l
+54.73 64.23 l
 54.83 64.25 l
 54.94 64.26 l
 55.04 64.28 l
@@ -315,7 +315,7 @@
 69.19 93.26 l
 69.29 93.95 l
 69.39 94.66 l
-69.49 95.38 l
+69.49 95.37 l
 69.59 96.11 l
 69.70 96.85 l
 69.80 97.61 l
@@ -351,8 +351,8 @@
 72.83 127.42 l
 72.93 128.67 l
 73.03 129.93 l
-73.13 131.21 l
-73.23 132.52 l
+73.13 131.22 l
+73.23 132.51 l
 73.34 133.83 l
 73.44 135.17 l
 73.54 136.52 l
@@ -367,7 +367,7 @@
 74.45 149.49 l
 74.55 151.02 l
 74.65 152.57 l
-74.75 154.14 l
+74.75 154.13 l
 74.85 155.72 l
 74.95 157.32 l
 75.05 158.94 l
@@ -375,14 +375,14 @@
 75.26 162.23 l
 75.36 163.91 l
 75.46 165.60 l
-75.56 167.30 l
+75.56 167.31 l
 75.66 169.03 l
 75.76 170.77 l
 75.86 172.53 l
 75.96 174.31 l
-76.06 176.11 l
+76.06 176.10 l
 76.17 177.92 l
-76.27 179.74 l
+76.27 179.75 l
 76.37 181.59 l
 76.47 183.45 l
 76.57 185.33 l
@@ -407,7 +407,7 @@
 78.49 223.93 l
 78.59 226.10 l
 78.69 228.28 l
-78.79 230.48 l
+78.79 230.47 l
 78.90 232.68 l
 79.00 234.90 l
 79.10 237.12 l
@@ -420,7 +420,7 @@
 79.81 252.99 l
 79.91 255.29 l
 80.01 257.60 l
-80.11 259.91 l
+80.11 259.92 l
 80.21 262.24 l
 80.31 264.57 l
 80.41 266.90 l
@@ -431,7 +431,7 @@
 80.92 278.66 l
 81.02 281.02 l
 81.12 283.39 l
-81.22 285.75 l
+81.22 285.76 l
 81.32 288.13 l
 81.42 290.50 l
 81.52 292.87 l
@@ -446,14 +446,14 @@
 82.43 314.20 l
 82.54 316.56 l
 82.64 318.92 l
-82.74 321.27 l
+82.74 321.26 l
 82.84 323.61 l
 82.94 325.94 l
 83.04 328.28 l
 83.14 330.60 l
 83.24 332.92 l
 83.34 335.23 l
-83.44 337.53 l
+83.44 337.52 l
 83.55 339.82 l
 83.65 342.10 l
 83.75 344.37 l
@@ -493,7 +493,7 @@
 87.19 411.66 l
 87.29 413.24 l
 87.39 414.79 l
-87.49 416.31 l
+87.49 416.32 l
 87.59 417.81 l
 87.69 419.27 l
 87.79 420.70 l
@@ -556,7 +556,7 @@
 93.55 443.69 l
 93.66 443.01 l
 93.76 442.29 l
-93.86 441.54 l
+93.86 441.53 l
 93.96 440.74 l
 94.06 439.92 l
 94.16 439.06 l
@@ -619,7 +619,7 @@
 99.92 344.06 l
 100.02 341.85 l
 100.13 339.63 l
-100.23 337.41 l
+100.23 337.40 l
 100.33 335.17 l
 100.43 332.93 l
 100.53 330.68 l
@@ -631,19 +631,19 @@
 101.14 317.07 l
 101.24 314.79 l
 101.34 312.50 l
-101.44 310.21 l
-101.54 307.92 l
-101.64 305.64 l
+101.44 310.22 l
+101.54 307.93 l
+101.64 305.63 l
 101.74 303.34 l
 101.84 301.05 l
-101.95 298.76 l
+101.95 298.75 l
 102.05 296.46 l
 102.15 294.17 l
 102.25 291.88 l
 102.35 289.59 l
 102.45 287.30 l
 102.55 285.02 l
-102.65 282.73 l
+102.65 282.74 l
 102.75 280.46 l
 102.86 278.18 l
 102.96 275.91 l
@@ -655,7 +655,7 @@
 103.56 262.39 l
 103.66 260.16 l
 103.77 257.93 l
-103.87 255.72 l
+103.87 255.71 l
 103.97 253.51 l
 104.07 251.30 l
 104.17 249.11 l
@@ -664,13 +664,13 @@
 104.47 242.59 l
 104.57 240.43 l
 104.68 238.28 l
-104.78 236.15 l
+104.78 236.14 l
 104.88 234.02 l
 104.98 231.90 l
 105.08 229.80 l
 105.18 227.71 l
 105.28 225.62 l
-105.38 223.55 l
+105.38 223.56 l
 105.48 221.50 l
 105.59 219.45 l
 105.69 217.42 l
@@ -700,8 +700,8 @@
 108.11 172.83 l
 108.21 171.16 l
 108.31 169.51 l
-108.42 167.87 l
-108.52 166.25 l
+108.42 167.88 l
+108.52 166.26 l
 108.62 164.65 l
 108.72 163.06 l
 108.82 161.49 l
@@ -724,8 +724,8 @@
 110.54 137.28 l
 110.64 136.00 l
 110.74 134.74 l
-110.84 133.50 l
-110.94 132.26 l
+110.84 133.49 l
+110.94 132.27 l
 111.04 131.05 l
 111.15 129.85 l
 111.25 128.67 l
@@ -733,7 +733,7 @@
 111.45 126.35 l
 111.55 125.21 l
 111.65 124.09 l
-111.75 122.98 l
+111.75 122.99 l
 111.85 121.89 l
 111.95 120.82 l
 112.06 119.76 l
@@ -760,7 +760,7 @@
 114.18 100.79 l
 114.28 100.03 l
 114.38 99.29 l
-114.48 98.56 l
+114.48 98.55 l
 114.58 97.84 l
 114.68 97.13 l
 114.78 96.43 l

Modified: branches/distr-2.2/pkg/distr/inst/doc/newDistributions.pdf
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrDoc/chm/distrDoc.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrEllipse/chm/00Index.html
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/chm/00Index.html	2009-07-03 05:29:25 UTC (rev 503)
+++ branches/distr-2.2/pkg/distrEllipse/chm/00Index.html	2009-07-07 21:41:19 UTC (rev 504)
@@ -10,7 +10,7 @@
 <param name="keyword" value=".. contents">
 </object>
 
-<h2>Help pages for package &lsquo;distrEllipse&rsquo; version 0.1</h2>
+<h2>Help pages for package &lsquo;distrEllipse&rsquo; version 0.2</h2>
 
 <p align="center">
 <a href="# "> </a>

Modified: branches/distr-2.2/pkg/distrEllipse/chm/distrEllipse.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrEx/chm/distrEx.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrEx/src/distrEx.dll
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrMod/chm/distrMod.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrSim/chm/distrSim.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrTEst/chm/distrTEst.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/distrTeach/chm/distrTeach.chm
===================================================================
(Binary files differ)

Modified: branches/distr-2.2/pkg/startupmsg/chm/startupmsg.chm
===================================================================
(Binary files differ)

Modified: pkg/SweaveListingUtils/DESCRIPTION
===================================================================
--- pkg/SweaveListingUtils/DESCRIPTION	2009-07-03 05:29:25 UTC (rev 503)
+++ pkg/SweaveListingUtils/DESCRIPTION	2009-07-07 21:41:19 UTC (rev 504)
@@ -1,6 +1,6 @@
 Package: SweaveListingUtils
 Title: Utilities for Sweave together with TeX listings package
-Version: 0.3
+Version: 0.3.1
 Depends: R(>= 2.0.0), startupmsg
 Suggests: distr
 Imports: stats
@@ -13,6 +13,6 @@
         vignette and documented source code
 Maintainer: Peter Ruckdeschel <Peter.Ruckdeschel at itwm.fraunhofer.de>
 License: LGPL-3
-Date: 2009-07-01
+Date: 2009-07-07
 LastChangedDate: {$LastChangedDate$}
 LastChangedRevision: {$LastChangedRevision$}

Modified: pkg/SweaveListingUtils/NAMESPACE
===================================================================
--- pkg/SweaveListingUtils/NAMESPACE	2009-07-03 05:29:25 UTC (rev 503)
+++ pkg/SweaveListingUtils/NAMESPACE	2009-07-07 21:41:19 UTC (rev 504)
@@ -5,5 +5,6 @@
        "readPkgVersion",  "SweaveListingOptions",
        "SweaveListingoptions", "getSweaveListingOption",
        "SweaveListingMASK", "setToBeDefinedPkgs","lstsetLanguage",
-       "changeKeywordstyles", "library", "require")
+       "changeKeywordstyles", "library", "require", 
+       "isBaseOrRecommended", "setBaseOrRecommended")
 S3method(print, taglist)
\ No newline at end of file

Modified: pkg/SweaveListingUtils/R/SweaveListingOptions.R
===================================================================
--- pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-07-03 05:29:25 UTC (rev 503)
+++ pkg/SweaveListingUtils/R/SweaveListingOptions.R	2009-07-07 21:41:19 UTC (rev 504)
@@ -24,6 +24,7 @@
                "commentstyle" = "{\\ttfamily\\itshape}",
                "alsolanguage" = "R"),
 Rcolor  = c(0,0.5,0.5),
+RRecomdcolor  = c(0,0.6,0.4),
 Rbcolor  = c(0,0.6,0.6),
 Rout     = c(0.461,0.039,0.102),
 Rcomment = c(0.101,0.043,0.432),
@@ -36,7 +37,9 @@
 inSweave = FALSE,
 fromRForge = TRUE,
 base.url = paste("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/",
-                            "*checkout*/pkg/", sep = "")
+                            "*checkout*/pkg/", sep = ""),
+addRset = TRUE,
+addRdset = TRUE
 )
 
 SweaveListingOptions <- function(...) {

Modified: pkg/SweaveListingUtils/R/SweaveListingUtils.R
===================================================================
--- pkg/SweaveListingUtils/R/SweaveListingUtils.R	2009-07-03 05:29:25 UTC (rev 503)
+++ pkg/SweaveListingUtils/R/SweaveListingUtils.R	2009-07-07 21:41:19 UTC (rev 504)
@@ -107,7 +107,8 @@
    return(invisible())
 }
 
-lstsetR <- function(Rset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{"){
+lstsetR <- function(Rset = NULL, LineLength = 80,
+                    add = getSweaveListingOption("addRset"), startS = "\\lstset{"){
    if(add){
        Rset0 <- getSweaveListingOption("Rset")
        if(length(Rset)){
@@ -122,7 +123,8 @@
    return(invisible())
 }
 
-lstsetRd <- function(Rdset = NULL, LineLength = 80, add = TRUE, startS = "\\lstset{"){
+lstsetRd <- function(Rdset = NULL, LineLength = 80,
+                    add = getSweaveListingOption("addRdset"), startS = "\\lstset{"){
    if(add){
        Rdset0 <- getSweaveListingOption("Rdset")
        if(length(Rdset)){
@@ -147,7 +149,8 @@
    Rset = getSweaveListingOption("Rset"), 
    Rdset = getSweaveListingOption("Rdset"), 
    Rcolor = getSweaveListingOption("Rcolor"), 
-   Rbcolor = getSweaveListingOption("Rbcolor"), 
+   RRecomdcolor = getSweaveListingOption("RRecomdcolor"),
+   Rbcolor = getSweaveListingOption("Rbcolor"),
    Rout = getSweaveListingOption("Rout"),
    Rcomment = getSweaveListingOption("Rcomment"), 
    pkg = getSweaveListingOption("pkg"), 
@@ -156,13 +159,13 @@
 
 sws <- .SweaveListingOptions
 sws$inSweave <- TRUE
+assignInNamespace(".SweaveListingOptions", sws, "SweaveListingUtils")
+
 withVerbatim <- rep(withVerbatim, length.out=3)
-
 if(is.null(names(withVerbatim)))
    names(withVerbatim) <- c("Sinput", "Soutput", "Scode")
 
 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/distr -r 504


More information about the Distr-commits mailing list