[Distr-commits] r642 - branches/distr-2.3/pkg/SweaveListingUtils/R branches/distr-2.3/pkg/SweaveListingUtils/inst/TeX branches/distr-2.3/pkg/SweaveListingUtils/inst/doc branches/distr-2.3/pkg/SweaveListingUtils/man pkg/SweaveListingUtils pkg/SweaveListingUtils/R pkg/SweaveListingUtils/inst/TeX pkg/SweaveListingUtils/inst/doc pkg/SweaveListingUtils/man pkg/distr/inst/doc

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 1 19:35:08 CET 2010


Author: ruckdeschel
Date: 2010-03-01 19:35:08 +0100 (Mon, 01 Mar 2010)
New Revision: 642

Modified:
   branches/distr-2.3/pkg/SweaveListingUtils/R/SweaveListingUtils.R
   branches/distr-2.3/pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty
   branches/distr-2.3/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw
   branches/distr-2.3/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
   branches/distr-2.3/pkg/SweaveListingUtils/man/copySourceFromRForge.Rd
   branches/distr-2.3/pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd
   branches/distr-2.3/pkg/SweaveListingUtils/man/lstset.Rd
   branches/distr-2.3/pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd
   pkg/SweaveListingUtils/DESCRIPTION
   pkg/SweaveListingUtils/R/SweaveListingUtils.R
   pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty
   pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw
   pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
   pkg/SweaveListingUtils/man/copySourceFromRForge.Rd
   pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd
   pkg/SweaveListingUtils/man/lstset.Rd
   pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd
   pkg/distr/inst/doc/Rplots.pdf
Log:
small changes in SweaveListingUtils in order to pass R CMD check again...

Modified: branches/distr-2.3/pkg/SweaveListingUtils/R/SweaveListingUtils.R
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/R/SweaveListingUtils.R	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/R/SweaveListingUtils.R	2010-03-01 18:35:08 UTC (rev 642)
@@ -237,19 +237,19 @@
 copySourceFromRForge <- function(PKG, TYPE, FILENAME, PROJECT, from, to,
                                  offset.before = 0, offset.after = 0,
                                  fromRForge = getSweaveListingOption("fromRForge"),
-                                 base.url = getSweaveListingOption("base.url") ){
+                                 base.url = getSweaveListingOption("base.url"), ... ){
    RL <- readSourceFromRForge(PKG, TYPE, FILENAME, PROJECT, 
                               fromRForge = fromRForge, base.url = base.url)
    lR <- length(RL)
    from <- if(missing(from)) 1 else {if(is.numeric(from))
                                         max(from-offset.before,1)
-                                     else {if(length(gr0 <- grep(from,RL)))
+                                     else {if(length(gr0 <- grep(from,RL, ...)))
                                             max(gr0[1]-offset.before,1) else lR
                                           }
                                     }
    to <- if(missing(to)) lR else {if(is.numeric(to))
                                         min(to+offset.after,lR)
-                                     else {if(length(gr1<-grep(to,RL[from:lR])))
+                                     else {if(length(gr1<-grep(to,RL[from:lR], ...)))
                                             min(from+gr1[1]-1+offset.after,lR)
                                            else 0
                                            }
@@ -266,7 +266,8 @@
                                  LineLength = getOption("width"),
                                  withLines = ifelse(TYPE=="R", TRUE, FALSE),
                                  fromRForge = getSweaveListingOption("fromRForge"),
-                                 base.url = getSweaveListingOption("base.url")){
+                                 base.url = getSweaveListingOption("base.url"), 
+                                 ...){
    line <- paste("%",paste(rep("-",LineLength-2),collapse=""),"%\n", sep="")
    dots <- match.call(call = sys.call(sys.parent(1)),
                        expand.dots = FALSE)$"..."
@@ -293,7 +294,7 @@
               argL[[j]] <- c(argL[[j]],to = toL[[j]])
           argL[[j]] <- c(argL[[j]], offset.before = offs.from[j],
                          offset.after = offs.to[j], 
-                         fromRForge = fromRForge[j], base.url = base.url[j])
+                         fromRForge = fromRForge[j], base.url = base.url[j],dots)
       }
    }else {
       argL <- argL0
@@ -301,7 +302,7 @@
       if(!missing(to)) argL <- c(argL, to = to)
       argL <- list(c(argL, offset.before = offset.before,
                         offset.after = offset.after, 
-                        fromRForge = fromRForge, base.url = base.url))
+                        fromRForge = fromRForge, base.url = base.url,dots))
    }
    erg <- lapply(argL, function(x)  do.call(copySourceFromRForge, args = c(x)))
    RL <- lapply(erg, function(x) x$text)

Modified: branches/distr-2.3/pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty	2010-03-01 18:35:08 UTC (rev 642)
@@ -4,12 +4,12 @@
           description,details,dfn,doctype,dots,%
           dontrun,dontshow,donttest,dQuote,%
           email,emph,enc,encoding,enumerate,env,eqn,%
-          examples,file,format,item,itemize,kbd,keyword,%
+          examples,file,format,if,ifelse,item,itemize,kbd,keyword,%
           ldots,link,linkS4class,method,name,note,%
-          option,pkg,preformatted,R,Rdopts,Rdversion,%
+          option,out,pkg,preformatted,R,Rdopts,Rdversion,%
           references,S3method,S4method,Sexpr,samp,section,%
-          seealso,source,sp,special,%
-          sQuote,strong,synopsis,tab,tabular,testonly,%
+          seealso,source,sp,special,sQuote,strong,%
+          subsection,synopsis,tab,tabular,testonly,%
           title,url,usage,value,var,verb},
    sensitive=true,%
    morecomment=[l]\%% 2008/9 Peter Ruckdeschel

Modified: branches/distr-2.3/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2010-03-01 18:35:08 UTC (rev 642)
@@ -497,9 +497,9 @@
 \newblock \hreft{http://cran.r-project.org/doc/Rnews/Rnews_2003-2.pdf}.
 %
 
-\bibitem[{Murdoch (2009)}]{Murd:08}
-Murdoch, D (2009)
-\newblock {Parsing Rd Files. Technical Report on {\tt developer.r-project.org}} as of Jun. 21 2009.
+\bibitem[{Murdoch (2010)}]{Murd:08}
+Murdoch, D (2010)
+\newblock {Parsing Rd Files. Technical Report on {\tt developer.r-project.org}} as of Jan. 1 2010.
 \newblock \hreft{http://developer.r-project.org/parseRd.pdf}.
 %
 
@@ -519,9 +519,10 @@
 %
 
 \end{thebibliography}
-<<cleanup, echo=FALSE>>=
-unloadNamespace("SweaveListingUtils")
-@
+%problem!
+%<<cleanup, echo=FALSE>>=
+%unloadNamespace("SweaveListingUtils")
+%@
 % -------------------------------------------------------------------------------
 \end{document}
 % -------------------------------------------------------------------------------

Modified: branches/distr-2.3/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -15,8 +15,8 @@
 \details{
 \tabular{ll}{
 Package: \tab SweaveListingUtils \cr
-Version: \tab 0.5 \cr
-Date: \tab 2009-11-01 \cr
+Version: \tab 0.5\cr
+Date: \tab 2010-03-01 \cr
 Depends: \tab R(>= 2.10.0), startupmsg \cr
 LazyLoad: \tab yes \cr
 License: \tab LGPL-3 \cr
@@ -30,7 +30,7 @@
 for \R. We enhance this definition and also introduce a corresponding 
 "language" definition file to typeset \file{.Rd} code 
 (file \file{Rdlistings.sty} in the \file{TeX} subfolder of this package,
-which is according to Duncan Murdoch's ``Parsing Rd Files'' as of Nov. 4 2008.).
+which is according to Duncan Murdoch's ``Parsing Rd Files'' as of Jan. 1 2010.).
 
 In recent versions \file{listings} also cooperates with TeX package 
 \file{fancyvrb}, so it can be configured to enhance Sweave typesetting.

Modified: branches/distr-2.3/pkg/SweaveListingUtils/man/copySourceFromRForge.Rd
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/man/copySourceFromRForge.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/man/copySourceFromRForge.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -9,7 +9,7 @@
 copySourceFromRForge(PKG, TYPE, FILENAME, PROJECT, from, to,
                      offset.before = 0, offset.after = 0,
                      fromRForge = getSweaveListingOption("fromRForge"),
-                     base.url = getSweaveListingOption("base.url") )
+                     base.url = getSweaveListingOption("base.url"), ... )
 }
 \arguments{
   \item{PKG}{character; name of package to be downloaded}
@@ -17,11 +17,11 @@
   \item{FILENAME}{character; the name of the source file to be downloaded}
   \item{PROJECT}{character; the name of the R-Forge project}
   \item{from}{single character  or single numeric or missing; if character,
-  the starting string being searched (by \code{grep}, hence as regular expression);
+  the starting string being searched (by \code{\link{grep}}, hence as regular expression);
   if numeric, the starting line number, if missing we begin with the first line
   of the file}
   \item{to}{single character  or single numeric or missing; if character,
-  the ending string being searched (by \code{grep}, hence as regular expression);
+  the ending string being searched (by \code{\link{grep}}, hence as regular expression);
   if numeric, the ending line number, if missing we end with the last line
   of the file}
   \item{offset.before}{numeric; number of lines to be included before the first
@@ -31,6 +31,7 @@
   \item{fromRForge}{logical; shall code be downloaded from an R-Forge mirror?
                     Defaults to the corresponding global option}
   \item{base.url}{character; base url from where to download the code sniplet}
+  \item{\dots}{further arguments to be passed on to \code{link[base]{grep}}}
   }
 
 \details{
@@ -41,7 +42,7 @@
 \item missing: then the whole file (resp. from the beginning or to the end) is used
 \item numbers: then the limits are just given as line numbers
 \item characters: then file is searched for the first occurrance of a passage
-      framed by \code{from}, \code{to}; uses \code{grep}; hence
+      framed by \code{from}, \code{to}; it uses \code{grep}; hence
       \link[=regexp]{regular expressions} may be used which involves masking
       of (,\{,\\, etc.  as described in the cited reference;
 }
@@ -58,7 +59,7 @@
 copySourceFromRForge("distr","R","AllClasses.R","distr", from =2, to =3,
                      offset.after=2)
 copySourceFromRForge("distr","R","AllClasses.R","distr", from ="setClass",
-                      to ="\}")
+                      to ="\\\\}")
 }
 \keyword{utilities}
 

Modified: branches/distr-2.3/pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -11,7 +11,7 @@
                          LineLength = getOption("width"),
                          withLines = ifelse(TYPE=="R", TRUE, FALSE),
                          fromRForge = getSweaveListingOption("fromRForge"),
-                         base.url = getSweaveListingOption("base.url"))
+                         base.url = getSweaveListingOption("base.url"), ...)
 }
 \arguments{
   \item{PKG}{character; name of package to be downloaded}
@@ -19,10 +19,14 @@
   \item{FILENAME}{character; the name of the source file to be downloaded}
   \item{PROJECT}{character; the name of the R-Forge project}
   \item{from}{vector of characters  or vector of numerics or missing;
-  beginnings of the code sniplets; for details see \code{\link{copySourceFromRForge}}
+  beginnings of the code sniplets; for details see 
+  \code{\link{copySourceFromRForge}}; note that you need to escape meta
+  characters if you use regular expressions, cf. \code{\link[base]{regex}}.
   }
   \item{to}{vector of characters  or vector of numerics or missing;
-  endings of the code sniplets; for details see \code{\link{copySourceFromRForge}}
+  endings of the code sniplets; for details see \code{\link{copySourceFromRForge}};
+  note that you need to escape meta
+  characters if you use regular expressions, cf. \code{\link[base]{regex}}.
   }
   \item{offset.before}{numeric; numbers of lines to be included before the code
                        sniplets; defaults to 0}
@@ -34,6 +38,7 @@
   \item{fromRForge}{logical; shall code be downloaded from an R-Forge mirror?
                     Defaults to the corresponding global option}
   \item{base.url}{character; base url from where to download the code sniplet}
+  \item{\dots}{further arguments to be passed on to \code{link[base]{grep}}}
   }
 
 \details{
@@ -52,12 +57,17 @@
 @
 %
 <<skew, results=tex, echo=FALSE>>=
-lstinputSourceFromRForge("distrEx","R","Skewness.R","distr",
-                     from = "\\"skewness\\", signature\\\\(x = \\"Binom\\"",
-                     to = "\\ \}\\\\)")
+}%
+\code{lstinputSourceFromRForge("distrEx","R","Skewness.R","distr",
+        from = "\\"skewness\\", signature\\\\(x = \\\\"Binom\\"",
+        to = "\\\\}\\\\)")
+}%
+\preformatted{
 @
-} (CAVEAT: the space between backslash and right brace in the line with "to = "
-is \emph{not} intended; I simply did not find another work-around)  \cr
+} 
+%(CAVEAT: the spaces between first and second backslash and before the right brace are
+% \emph{not} intended; I simply did not find another work-around)  \cr
+
 Within \file{.Rd} code, examples are type-set in \file{.R} style;
 vectors are allowed for arguments \code{from}, \code{to};
 \code{lstinputSourceFromRForge} uses

Modified: branches/distr-2.3/pkg/SweaveListingUtils/man/lstset.Rd
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/man/lstset.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/man/lstset.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -12,33 +12,33 @@
 \description{
 Functions for defining how listings prints R and Rd source code}
 \usage{
-lstset(taglist, LineLength = getOption("width"), startS = "\\\\lstset\{")
+lstset(taglist, LineLength = getOption("width"), startS = "\\\\lstset{")
 lstsetR(Rset = NULL, LineLength = getOption("width"),
         add = getSweaveListingOption("addRset"),
-        startS = "\\\\lstset\{", append = TRUE, withRstyle = FALSE)
+        startS = "\\\\lstset{", append = TRUE, withRstyle = FALSE)
 lstsetRd(Rdset = NULL, LineLength = getOption("width"),
          add = getSweaveListingOption("addRdset"),
-         startS = "\\\\lstset\{",
+         startS = "\\\\lstset{",
                     append = TRUE)
 lstsetRin(Rinset = NULL, LineLength = getOption("width"),
           add = getSweaveListingOption("addRinset"),
-          startS = "\\\\lstdefinestyle\{Rinstyle\}\{",
+          startS = "\\\\lstdefinestyle{Rinstyle}{",
                     append = TRUE)
 lstsetRout(Routset = NULL, LineLength = getOption("width"),
            add = getSweaveListingOption("addRoutset"),
-           startS = "\\\\lstdefinestyle\{Routstyle\}\{",
+           startS = "\\\\lstdefinestyle{Routstyle}{",
                     append = TRUE)
 lstsetRcode(Rcodeset = NULL, LineLength = getOption("width"),
             add = getSweaveListingOption("addRcodeset"),
-            startS = "\\\\lstdefinestyle\{Rcodestyle\}\{",
+            startS = "\\\\lstdefinestyle{Rcodestyle}{",
                     append = TRUE)
 lstsetRall(Rallset = NULL, LineLength = getOption("width"),
            add = c("in" = getSweaveListingOption("addRinset"),
                    "out" = getSweaveListingOption("addRoutset"),
                    "code" = getSweaveListingOption("addRcodeset")),
-           startS = c("in" = "\\\\lstdefinestyle\{Rinstyle\}\{",
-                      "out" = "\\\\lstdefinestyle\{Routstyle\}\{",
-                      "code" = "\\\\lstdefinestyle\{Rcodestyle\}\{"),
+           startS = c("in" = "\\\\lstdefinestyle{Rinstyle}{",
+                      "out" = "\\\\lstdefinestyle{Routstyle}{",
+                      "code" = "\\\\lstdefinestyle{Rcodestyle}{"),
            append = c("in" = TRUE, "out" = TRUE, "code" = TRUE),
            withOptionsDefAppend = TRUE)
 lstdefRstyle(Rset = NULL, LineLength = getOption("width"),
@@ -134,7 +134,7 @@
 \author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
 \examples{
 lstset(taglist(A="H", b=2, 3),30)
-lstset(taglist(A="H", b=2, 3),30, startS = "\\\\lstdefinestyle{Rstyle}\{")
+lstset(taglist(A="H", b=2, 3),30, startS = "\\\\lstdefinestyle{Rstyle}{")
 lstsetR()
 lstsetRd()
 }

Modified: branches/distr-2.3/pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd
===================================================================
--- branches/distr-2.3/pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ branches/distr-2.3/pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -42,7 +42,7 @@
 \author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
 \examples{
 setToBeDefinedPkgs(pkgs = c("distr","distrEx"),
-                   keywordstyles = paste("\\bfseries\\color{",c("blue","red"),"}",
+                   keywordstyles = paste("\\\\bfseries\\\\color{",c("blue","red"),"}",
                          sep="", collapse=""))
 ### not to be used:
 print(SweaveListingUtils:::.tobeDefinedPkgs)

Modified: pkg/SweaveListingUtils/DESCRIPTION
===================================================================
--- pkg/SweaveListingUtils/DESCRIPTION	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/DESCRIPTION	2010-03-01 18:35:08 UTC (rev 642)
@@ -1,7 +1,7 @@
 Package: SweaveListingUtils
 Title: Utilities for Sweave together with TeX listings package
 Encoding: latin1
-Version: 0.4.1
+Version: 0.4.3
 Depends: R(>= 2.10.0), startupmsg
 Suggests: distr
 Imports: stats
@@ -12,6 +12,6 @@
                source code
 Maintainer: Peter Ruckdeschel <Peter.Ruckdeschel at itwm.fraunhofer.de>
 License: LGPL-3
-Date: 2010-01-17
+Date: 2010-03-01
 LastChangedDate: {$LastChangedDate$}
 LastChangedRevision: {$LastChangedRevision$}

Modified: pkg/SweaveListingUtils/R/SweaveListingUtils.R
===================================================================
--- pkg/SweaveListingUtils/R/SweaveListingUtils.R	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/R/SweaveListingUtils.R	2010-03-01 18:35:08 UTC (rev 642)
@@ -237,19 +237,19 @@
 copySourceFromRForge <- function(PKG, TYPE, FILENAME, PROJECT, from, to,
                                  offset.before = 0, offset.after = 0,
                                  fromRForge = getSweaveListingOption("fromRForge"),
-                                 base.url = getSweaveListingOption("base.url") ){
+                                 base.url = getSweaveListingOption("base.url"), ... ){
    RL <- readSourceFromRForge(PKG, TYPE, FILENAME, PROJECT, 
                               fromRForge = fromRForge, base.url = base.url)
    lR <- length(RL)
    from <- if(missing(from)) 1 else {if(is.numeric(from))
                                         max(from-offset.before,1)
-                                     else {if(length(gr0 <- grep(from,RL)))
+                                     else {if(length(gr0 <- grep(from,RL, ...)))
                                             max(gr0[1]-offset.before,1) else lR
                                           }
                                     }
    to <- if(missing(to)) lR else {if(is.numeric(to))
                                         min(to+offset.after,lR)
-                                     else {if(length(gr1<-grep(to,RL[from:lR])))
+                                     else {if(length(gr1<-grep(to,RL[from:lR], ...)))
                                             min(from+gr1[1]-1+offset.after,lR)
                                            else 0
                                            }
@@ -266,7 +266,8 @@
                                  LineLength = getOption("width"),
                                  withLines = ifelse(TYPE=="R", TRUE, FALSE),
                                  fromRForge = getSweaveListingOption("fromRForge"),
-                                 base.url = getSweaveListingOption("base.url")){
+                                 base.url = getSweaveListingOption("base.url"), 
+                                 ...){
    line <- paste("%",paste(rep("-",LineLength-2),collapse=""),"%\n", sep="")
    dots <- match.call(call = sys.call(sys.parent(1)),
                        expand.dots = FALSE)$"..."
@@ -293,7 +294,7 @@
               argL[[j]] <- c(argL[[j]],to = toL[[j]])
           argL[[j]] <- c(argL[[j]], offset.before = offs.from[j],
                          offset.after = offs.to[j], 
-                         fromRForge = fromRForge[j], base.url = base.url[j])
+                         fromRForge = fromRForge[j], base.url = base.url[j],dots)
       }
    }else {
       argL <- argL0
@@ -301,7 +302,7 @@
       if(!missing(to)) argL <- c(argL, to = to)
       argL <- list(c(argL, offset.before = offset.before,
                         offset.after = offset.after, 
-                        fromRForge = fromRForge, base.url = base.url))
+                        fromRForge = fromRForge, base.url = base.url,dots))
    }
    erg <- lapply(argL, function(x)  do.call(copySourceFromRForge, args = c(x)))
    RL <- lapply(erg, function(x) x$text)

Modified: pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty
===================================================================
--- pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/inst/TeX/Rdlisting.sty	2010-03-01 18:35:08 UTC (rev 642)
@@ -4,12 +4,12 @@
           description,details,dfn,doctype,dots,%
           dontrun,dontshow,donttest,dQuote,%
           email,emph,enc,encoding,enumerate,env,eqn,%
-          examples,file,format,item,itemize,kbd,keyword,%
+          examples,file,format,if,ifelse,item,itemize,kbd,keyword,%
           ldots,link,linkS4class,method,name,note,%
-          option,pkg,preformatted,R,Rdopts,Rdversion,%
+          option,out,pkg,preformatted,R,Rdopts,Rdversion,%
           references,S3method,S4method,Sexpr,samp,section,%
-          seealso,source,sp,special,%
-          sQuote,strong,synopsis,tab,tabular,testonly,%
+          seealso,source,sp,special,sQuote,strong,%
+          subsection,synopsis,tab,tabular,testonly,%
           title,url,usage,value,var,verb},
    sensitive=true,%
    morecomment=[l]\%% 2008/9 Peter Ruckdeschel

Modified: pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw
===================================================================
--- pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/inst/doc/ExampleSweaveListingUtils.Rnw	2010-03-01 18:35:08 UTC (rev 642)
@@ -497,9 +497,9 @@
 \newblock \hreft{http://cran.r-project.org/doc/Rnews/Rnews_2003-2.pdf}.
 %
 
-\bibitem[{Murdoch (2009)}]{Murd:08}
-Murdoch, D (2009)
-\newblock {Parsing Rd Files. Technical Report on {\tt developer.r-project.org}} as of Jun. 21 2009.
+\bibitem[{Murdoch (2010)}]{Murd:08}
+Murdoch, D (2010)
+\newblock {Parsing Rd Files. Technical Report on {\tt developer.r-project.org}} as of Jan. 1 2010.
 \newblock \hreft{http://developer.r-project.org/parseRd.pdf}.
 %
 
@@ -519,9 +519,10 @@
 %
 
 \end{thebibliography}
-<<cleanup, echo=FALSE>>=
-unloadNamespace("SweaveListingUtils")
-@
+%problem!
+%<<cleanup, echo=FALSE>>=
+%unloadNamespace("SweaveListingUtils")
+%@
 % -------------------------------------------------------------------------------
 \end{document}
 % -------------------------------------------------------------------------------

Modified: pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
===================================================================
--- pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -15,8 +15,8 @@
 \details{
 \tabular{ll}{
 Package: \tab SweaveListingUtils \cr
-Version: \tab 0.4.1 \cr
-Date: \tab 2010-01-17 \cr
+Version: \tab 0.4.2 \cr
+Date: \tab 2010-03-01 \cr
 Depends: \tab R(>= 2.10.0), startupmsg \cr
 LazyLoad: \tab yes \cr
 License: \tab LGPL-3 \cr
@@ -30,7 +30,7 @@
 for \R. We enhance this definition and also introduce a corresponding 
 "language" definition file to typeset \file{.Rd} code 
 (file \file{Rdlistings.sty} in the \file{TeX} subfolder of this package,
-which is according to Duncan Murdoch's ``Parsing Rd Files'' as of Nov. 4 2008.).
+which is according to Duncan Murdoch's ``Parsing Rd Files'' as of Jan. 1 2010.).
 
 In recent versions \file{listings} also cooperates with TeX package 
 \file{fancyvrb}, so it can be configured to enhance Sweave typesetting.

Modified: pkg/SweaveListingUtils/man/copySourceFromRForge.Rd
===================================================================
--- pkg/SweaveListingUtils/man/copySourceFromRForge.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/man/copySourceFromRForge.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -9,7 +9,7 @@
 copySourceFromRForge(PKG, TYPE, FILENAME, PROJECT, from, to,
                      offset.before = 0, offset.after = 0,
                      fromRForge = getSweaveListingOption("fromRForge"),
-                     base.url = getSweaveListingOption("base.url") )
+                     base.url = getSweaveListingOption("base.url"), ... )
 }
 \arguments{
   \item{PKG}{character; name of package to be downloaded}
@@ -17,11 +17,11 @@
   \item{FILENAME}{character; the name of the source file to be downloaded}
   \item{PROJECT}{character; the name of the R-Forge project}
   \item{from}{single character  or single numeric or missing; if character,
-  the starting string being searched (by \code{grep}, hence as regular expression);
+  the starting string being searched (by \code{\link{grep}}, hence as regular expression);
   if numeric, the starting line number, if missing we begin with the first line
   of the file}
   \item{to}{single character  or single numeric or missing; if character,
-  the ending string being searched (by \code{grep}, hence as regular expression);
+  the ending string being searched (by \code{\link{grep}}, hence as regular expression);
   if numeric, the ending line number, if missing we end with the last line
   of the file}
   \item{offset.before}{numeric; number of lines to be included before the first
@@ -31,6 +31,7 @@
   \item{fromRForge}{logical; shall code be downloaded from an R-Forge mirror?
                     Defaults to the corresponding global option}
   \item{base.url}{character; base url from where to download the code sniplet}
+  \item{\dots}{further arguments to be passed on to \code{link[base]{grep}}}
   }
 
 \details{
@@ -41,7 +42,7 @@
 \item missing: then the whole file (resp. from the beginning or to the end) is used
 \item numbers: then the limits are just given as line numbers
 \item characters: then file is searched for the first occurrance of a passage
-      framed by \code{from}, \code{to}; uses \code{grep}; hence
+      framed by \code{from}, \code{to}; it uses \code{grep}; hence
       \link[=regexp]{regular expressions} may be used which involves masking
       of (,\{,\\, etc.  as described in the cited reference;
 }
@@ -58,7 +59,7 @@
 copySourceFromRForge("distr","R","AllClasses.R","distr", from =2, to =3,
                      offset.after=2)
 copySourceFromRForge("distr","R","AllClasses.R","distr", from ="setClass",
-                      to ="\}")
+                      to ="\\\\}")
 }
 \keyword{utilities}
 

Modified: pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd
===================================================================
--- pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/man/lstinputSourceFromRForge.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -11,7 +11,7 @@
                          LineLength = getOption("width"),
                          withLines = ifelse(TYPE=="R", TRUE, FALSE),
                          fromRForge = getSweaveListingOption("fromRForge"),
-                         base.url = getSweaveListingOption("base.url"))
+                         base.url = getSweaveListingOption("base.url"), ...)
 }
 \arguments{
   \item{PKG}{character; name of package to be downloaded}
@@ -19,10 +19,14 @@
   \item{FILENAME}{character; the name of the source file to be downloaded}
   \item{PROJECT}{character; the name of the R-Forge project}
   \item{from}{vector of characters  or vector of numerics or missing;
-  beginnings of the code sniplets; for details see \code{\link{copySourceFromRForge}}
+  beginnings of the code sniplets; for details see 
+  \code{\link{copySourceFromRForge}}; note that you need to escape meta
+  characters if you use regular expressions, cf. \code{\link[base]{regex}}.
   }
   \item{to}{vector of characters  or vector of numerics or missing;
-  endings of the code sniplets; for details see \code{\link{copySourceFromRForge}}
+  endings of the code sniplets; for details see \code{\link{copySourceFromRForge}};
+  note that you need to escape meta
+  characters if you use regular expressions, cf. \code{\link[base]{regex}}.
   }
   \item{offset.before}{numeric; numbers of lines to be included before the code
                        sniplets; defaults to 0}
@@ -34,6 +38,7 @@
   \item{fromRForge}{logical; shall code be downloaded from an R-Forge mirror?
                     Defaults to the corresponding global option}
   \item{base.url}{character; base url from where to download the code sniplet}
+  \item{\dots}{further arguments to be passed on to \code{link[base]{grep}}}
   }
 
 \details{
@@ -52,12 +57,17 @@
 @
 %
 <<skew, results=tex, echo=FALSE>>=
-lstinputSourceFromRForge("distrEx","R","Skewness.R","distr",
-                     from = "\\"skewness\\", signature\\\\(x = \\"Binom\\"",
-                     to = "\\ \}\\\\)")
+}%
+\code{lstinputSourceFromRForge("distrEx","R","Skewness.R","distr",
+        from = "\\"skewness\\", signature\\\\(x = \\\\"Binom\\"",
+        to = "\\\\}\\\\)")
+}%
+\preformatted{
 @
-} (CAVEAT: the space between backslash and right brace in the line with "to = "
-is \emph{not} intended; I simply did not find another work-around)  \cr
+} 
+%(CAVEAT: the spaces between first and second backslash and before the right brace are
+% \emph{not} intended; I simply did not find another work-around)  \cr
+
 Within \file{.Rd} code, examples are type-set in \file{.R} style;
 vectors are allowed for arguments \code{from}, \code{to};
 \code{lstinputSourceFromRForge} uses

Modified: pkg/SweaveListingUtils/man/lstset.Rd
===================================================================
--- pkg/SweaveListingUtils/man/lstset.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/man/lstset.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -12,33 +12,33 @@
 \description{
 Functions for defining how listings prints R and Rd source code}
 \usage{
-lstset(taglist, LineLength = getOption("width"), startS = "\\\\lstset\{")
+lstset(taglist, LineLength = getOption("width"), startS = "\\\\lstset{")
 lstsetR(Rset = NULL, LineLength = getOption("width"),
         add = getSweaveListingOption("addRset"),
-        startS = "\\\\lstset\{", append = TRUE, withRstyle = FALSE)
+        startS = "\\\\lstset{", append = TRUE, withRstyle = FALSE)
 lstsetRd(Rdset = NULL, LineLength = getOption("width"),
          add = getSweaveListingOption("addRdset"),
-         startS = "\\\\lstset\{",
+         startS = "\\\\lstset{",
                     append = TRUE)
 lstsetRin(Rinset = NULL, LineLength = getOption("width"),
           add = getSweaveListingOption("addRinset"),
-          startS = "\\\\lstdefinestyle\{Rinstyle\}\{",
+          startS = "\\\\lstdefinestyle{Rinstyle}{",
                     append = TRUE)
 lstsetRout(Routset = NULL, LineLength = getOption("width"),
            add = getSweaveListingOption("addRoutset"),
-           startS = "\\\\lstdefinestyle\{Routstyle\}\{",
+           startS = "\\\\lstdefinestyle{Routstyle}{",
                     append = TRUE)
 lstsetRcode(Rcodeset = NULL, LineLength = getOption("width"),
             add = getSweaveListingOption("addRcodeset"),
-            startS = "\\\\lstdefinestyle\{Rcodestyle\}\{",
+            startS = "\\\\lstdefinestyle{Rcodestyle}{",
                     append = TRUE)
 lstsetRall(Rallset = NULL, LineLength = getOption("width"),
            add = c("in" = getSweaveListingOption("addRinset"),
                    "out" = getSweaveListingOption("addRoutset"),
                    "code" = getSweaveListingOption("addRcodeset")),
-           startS = c("in" = "\\\\lstdefinestyle\{Rinstyle\}\{",
-                      "out" = "\\\\lstdefinestyle\{Routstyle\}\{",
-                      "code" = "\\\\lstdefinestyle\{Rcodestyle\}\{"),
+           startS = c("in" = "\\\\lstdefinestyle{Rinstyle}{",
+                      "out" = "\\\\lstdefinestyle{Routstyle}{",
+                      "code" = "\\\\lstdefinestyle{Rcodestyle}{"),
            append = c("in" = TRUE, "out" = TRUE, "code" = TRUE),
            withOptionsDefAppend = TRUE)
 lstdefRstyle(Rset = NULL, LineLength = getOption("width"),
@@ -134,7 +134,7 @@
 \author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
 \examples{
 lstset(taglist(A="H", b=2, 3),30)
-lstset(taglist(A="H", b=2, 3),30, startS = "\\\\lstdefinestyle{Rstyle}\{")
+lstset(taglist(A="H", b=2, 3),30, startS = "\\\\lstdefinestyle{Rstyle}{")
 lstsetR()
 lstsetRd()
 }

Modified: pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd
===================================================================
--- pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd	2010-02-07 22:12:01 UTC (rev 641)
+++ pkg/SweaveListingUtils/man/setToBeDefinedPkgs.Rd	2010-03-01 18:35:08 UTC (rev 642)
@@ -42,7 +42,7 @@
[TRUNCATED]

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


More information about the Distr-commits mailing list