[Roxygen-commits] r181 - in pkg: . R inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Aug 25 06:08:29 CEST 2008
Author: pcd
Date: 2008-08-25 06:08:29 +0200 (Mon, 25 Aug 2008)
New Revision: 181
Modified:
pkg/R/Rd.R
pkg/R/callgraph.R
pkg/R/namespace.R
pkg/R/roxygenize.R
pkg/README
pkg/inst/doc/hello-roxygen.R
pkg/inst/doc/pseudoprime.R
pkg/inst/doc/roxygen.Rnw
Log:
tag-aliases to make.*.roclet; recursive dir.create; figure here; pre import in DESCRIPTION;
Modified: pkg/R/Rd.R
===================================================================
--- pkg/R/Rd.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/R/Rd.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -5,12 +5,6 @@
#' @include parse.R
roxygen()
-#' Rd value parsers
-#' @name name
-#' @aliases name aliases title usage references concept
-#' note seealso example examples keywords return author
-#' TODO
-#' @seealso make.Rd.roclet
register.preref.parsers(parse.value,
'name',
'aliases',
@@ -27,37 +21,21 @@
'author',
'TODO')
-#' Rd name-description parsers
-#' @name param
-#' @aliases param method
-#' @seealso make.Rd.roclet
register.preref.parsers(parse.name.description,
'param',
'method')
-#' Rd name parser
-#' @name docType
-#' @seealso make.Rd.roclet
register.preref.parsers(parse.name,
'docType')
-#' Rd srcref parsers
-#' @name setClass
-#' @seealso make.Rd.roclet
register.srcref.parser('setClass',
function(pivot, expression)
list(S4class=car(expression)))
-#' Rd srcref parsers
-#' @name setGeneric
-#' @seealso make.Rd.roclet
register.srcref.parser('setGeneric',
function(pivot, expression)
list(S4generic=car(expression)))
-#' Rd srcref parsers
-#' @name setMethod
-#' @seealso make.Rd.roclet
register.srcref.parser('setMethod',
function(pivot, expression)
list(S4method=car(expression),
@@ -169,6 +147,10 @@
#' roclet <- make.Rd.roclet('man')
#' \dontrun{roclet$parse('example.R')}
#' @export
+#' @aliases name aliases title usage references concept
+#' note seealso example examples keywords return author
+#' TODO param method setClass setGeneric setMethod
+#' make.Rd.roclet
make.Rd.roclet <- function(subdir=NULL,
verbose=TRUE) {
#' Translate a key and expressions into an Rd expression;
Modified: pkg/R/callgraph.R
===================================================================
--- pkg/R/callgraph.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/R/callgraph.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -3,22 +3,27 @@
#' @include functional.R
roxygen()
-#' Callgraph value parsers
-#' @name callGraphDepth
-#' @seealso make.callgraph.roclet
register.preref.parsers(parse.value,
'callGraphDepth')
-#' Callgraph toggle parsers
-#' @name callGraph
-#' @aliases callGraph callGraphPrimitives
-#' @seealso make.callgraph.roclet
register.preref.parsers(parse.toggle,
'callGraph',
'callGraphPrimitives')
-#' Make a callgraph roclet.
+#' Make a callgraph roclet which produces a static call graph
+#' from a given function at a given depth with or without
+#' primitives.
#'
+#' The callgraph roclet supports the following tags:
+#'
+#' \enumerate{
+#' \item{\code{@@callGraph}}{Create a call graph of the default
+#' depth (currently 2), excluding primitive functions.}
+#' \item{\code{@@callGraphPrimitives}{Create a call graph of the
+#' default depth (currently 2), including primitive functions.}
+#' \item{\code{@@callGraphDepth}{Change the depth of the callgraph
+#' from the default of 2.}
+#'
#' The callgraph roclet is awkward in the sense that
#' it requires a function's package to be loadable;
#' which means, like calling LaTeX multiple times,
@@ -37,6 +42,8 @@
#' \item{Text-only option}{Option for text-only callgraphs
#' (which are clearer, in my opinion)}
#' }
+#' @aliases make.callgraph.roclet callGraph callGraphPrimitives
+#' callGraphDepth
make.callgraph.roclet <- function(dependencies=NULL,
dir='.',
verbose=TRUE) {
Modified: pkg/R/namespace.R
===================================================================
--- pkg/R/namespace.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/R/namespace.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -4,19 +4,9 @@
#' @include string.R
roxygen()
-#' Namespace default parser
-#' @name export
-#' @title Namespace default parser
-#' @seealso make.namespace.parser
register.preref.parsers(parse.default,
'export')
-#' Namespace value parsers
-#' @name exportClass
-#' @aliases exportClass exportMethod exportPattern
-#' S3method import importFrom importClassesFrom
-#' importMethodsFrom
-#' @seealso make.namespace.roclet
register.preref.parsers(parse.value,
'exportClass',
'exportMethod',
@@ -89,6 +79,9 @@
#' roclet <- make.namespace.roclet()
#' \dontrun{roclet$parse('example.R')}
#' @export
+#' @aliases make.namespace.roclet exportClass exportMethod
+#' exportPattern S3method import importFrom importClassesFrom
+#' importMethodsFrom export
make.namespace.roclet <- function(outfile='',
verbose=TRUE) {
parse.directive <- function(proc, parms)
Modified: pkg/R/roxygenize.R
===================================================================
--- pkg/R/roxygenize.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/R/roxygenize.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -98,7 +98,9 @@
overwrite=overwrite,
verbose=FALSE)
- for (dir in skeleton) dir.create(dir, showWarnings=FALSE)
+ for (dir in skeleton) dir.create(dir,
+ recursive=TRUE,
+ showWarnings=FALSE)
r.dir <- file.path(package.dir, R.DIR)
files <- as.list(list.files(r.dir,
pattern='\\.(R|r)$',
Modified: pkg/README
===================================================================
--- pkg/README 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/README 2008-08-25 04:08:29 UTC (rev 181)
@@ -41,6 +41,9 @@
* Edit the R emacs mode to identify roxygen delimiters when filling,
etc.
+ * The ESS team is working on it; loosened up the line-delimiter
+ to include "#+'".
+
* Find a reasonable way to document the inner functions of
make.roclet, etc.
@@ -48,8 +51,15 @@
* @defunct, @deprecated, @internal
+ * Alias roclet-specific tags to make.*.roclet; and built-in tags
+ to an ad-hoc explanation.
+
1.3. BUGS
+ * @import, @importFrom, @importClassesFrom, @importMethodsFrom should
+ update the `Depends' field in DESCRIPTION; or should we have separate
+ @depends, @suggests, @imports, @enhances?
+
* parse.formals doesn't distinguish between no default argument and
NULL; need a special value?
Modified: pkg/inst/doc/hello-roxygen.R
===================================================================
--- pkg/inst/doc/hello-roxygen.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/inst/doc/hello-roxygen.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -1,3 +1,6 @@
+#' A toy package to check Roxygen's sanity
+#'
#' @name helloRoxygen-package
#' @docType package
+#' @import roxygen
roxygen()
Modified: pkg/inst/doc/pseudoprime.R
===================================================================
--- pkg/inst/doc/pseudoprime.R 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/inst/doc/pseudoprime.R 2008-08-25 04:08:29 UTC (rev 181)
@@ -9,6 +9,8 @@
#' @param n the integer to test for primality
#' @return Whether the integer passes the Fermat test
#' for a randomized \eqn{0 < a < n}
+#' @callGraphPrimitives
+#' @callGraphDepth 5
#' @note \code{fermat.test} doesn't work for integers above
#' approximately fifteen because modulus loses precision.
fermat.test <- function(n) {
Modified: pkg/inst/doc/roxygen.Rnw
===================================================================
--- pkg/inst/doc/roxygen.Rnw 2008-08-25 04:08:25 UTC (rev 180)
+++ pkg/inst/doc/roxygen.Rnw 2008-08-25 04:08:29 UTC (rev 181)
@@ -4,7 +4,7 @@
\newcommand{\Roxygen}{\texttt{Roxygen}}
%% filename, caption, label
\newcommand{\listing}[3]{ %
- \begin{figure} %
+ \begin{figure}[h] %
\centering %
\VerbatimInput[numbers=left, %
frame=single, %
@@ -37,17 +37,25 @@
A minimal example that serves as a sanity check is found in
\texttt{hello-roxygen.R} (see Figure \ref{hello-roxygen}). It merely
-replaces the package description so that \texttt{R CMD check} will run
+replaces the package description so that `\texttt{R CMD check}' will run
after \Roxygen{} has processed the package skeleton:
-<<results=hide, keep.source=true>>=
+<<keep.source=true>>=
library(roxygen)
package.skeleton('helloRoxygen',
code_files='hello-roxygen.R',
force=TRUE)
-# `R CMD roxygen helloRoxygen' works, too.
-roxygenize('helloRoxygen')
+# `R CMD roxygen -d helloRoxygen' works, too.
+roxygenize('helloRoxygen',
+ roxygen.dir='helloRoxygen',
+ copy.package=FALSE,
+ unlink.target=FALSE)
@
+
+A new \texttt{helloRoxygen/man/helloRoxygen-package.Rd} should have
+been created with the contents of Figure \ref{hello-roxygen}; and
+`\texttt{R CMD check helloRoxygen}' should terminate successfully.
+
\listing{pseudoprime.R}
{Roxygen example \texttt{pseudoprime.R}}
{pseudoprime}
More information about the Roxygen-commits
mailing list