[Roxygen-commits] r257 - pkg/inst/doc
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Mar 21 10:51:56 CET 2011
Author: pcd
Date: 2011-03-21 10:51:55 +0100 (Mon, 21 Mar 2011)
New Revision: 257
Modified:
pkg/inst/doc/roxygen.Rnw
Log:
use R CMD roxygen instead of roxygenize
Modified: pkg/inst/doc/roxygen.Rnw
===================================================================
--- pkg/inst/doc/roxygen.Rnw 2011-03-21 09:46:08 UTC (rev 256)
+++ pkg/inst/doc/roxygen.Rnw 2011-03-21 09:51:55 UTC (rev 257)
@@ -1,179 +1,186 @@
-\documentclass{article}
-\usepackage[utf8]{inputenc}
-\usepackage{fancyvrb}
-\usepackage[pdfborder={0 0 0}]{hyperref}
-\usepackage{url}
-\usepackage{upquote}
-\usepackage{graphicx}
-\usepackage{grffile}
-\usepackage{float}
-\usepackage{natbib}
-%% \VignetteIndexEntry{Roxygen Vignette}
-\newcommand{\Roxygen}{\texttt{Roxygen}}
-%% path, filename, caption, label
-\newcommand{\listing}[4]{ %
- \begin{figure}[H] %
- \centering %
- \VerbatimInput[numbers=left, %
- frame=single, %
- label=#2]{#1} %
- \caption{#3} %
- \label{#4} %
- \end{figure} %
-}
-\author{Peter Danenberg \url{<pcd at roxygen.org>}}
-\title{\Roxygen{} Vignette}
-\begin{document}
-\maketitle
-\begin{abstract}
- The purpose of the \Roxygen{} Vignette is to show how to get up and
- running with \Roxygen{}; for details, including a complete list of
- tags, consult the help pages or manual for:
- \begin{itemize}
- \item \texttt{make.callgraph.roclet}
- \item \texttt{make.collate.roclet}
- \item \texttt{make.namespace.roclet}
- \item \texttt{make.Rd.roclet}
- \end{itemize}
-\end{abstract}
-\tableofcontents
-\section{Minimal Example: ``Hello, Roxygen!''}
-
-\listing{hello-roxygen.R}
- {hello-roxygen.R}
- {Roxygen sanity-check}
- {hello-roxygen}
-
-\texttt{hello-roxygen.R} (fig. \ref{hello-roxygen}) is a minimal
-example to check the sanity of your \Roxygen{} installation. It merely
-replaces the package description so that `\texttt{R CMD check}' will
-run after \Roxygen{} has processed the package skeleton:
-
-<<keep.source=true>>=
-library(roxygen)
-package.skeleton('helloRoxygen',
- code_files='hello-roxygen.R',
- force=TRUE)
-# `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.
-
-\section{Example: Pseudoprimality}
-
-\subsection{Package Description}
-
-\listing{pseudoprime/R/pseudoprime-package.R}
- {pseudoprime-package.R}
- {Package description for \texttt{pseudoprime}}
- {pseudoprime-package}
-
-One could imagine, for instance, a less trivial package that actually
-does something; enter \texttt{pseudoprime}, a toy that tests for
-primes using Fermat's little
-theorem.\footnote{\href{http://en.wikipedia.org/wiki/Fermat\%27s_little_theorem}{http://en.wikipedia.org/wiki/Fermat\textquotesingle s\_little\_theorem}}
-
-A package description has been provided in figure
-\ref{pseudoprime-package}; notice the \texttt{roxygen()} statement in
-line 30: each \Roxygen{} description block must be followed by a
-statement, even header material that describes a file or package in
-lieu of a specific function. \texttt{roxygen()} is provided as a
-\texttt{NOOP} (null statement) to stand in for such cases.
-
-The first sentence of any \Roxygen{} block briefly describes its
-object; and may be followed directly by a \Roxygen{} tag
-(fig. \ref{hello-roxygen}, line 2) or a more detailed description
-(fig. \ref{pseudoprime-package}, line 3). The detailed description
-begins after the intervening blank line, and continues until the first
-\Roxygen{} tag (fig. \ref{pseudoprime-package}, line 19).
-
-Each \Roxygen{} tag begins with an asperand, like \texttt{@name},
-\texttt{@author}, etc.; which means, incidentally, that all real
-asperands have to be escaped with a double-asperand, as in
-\verb=\email{pcd@@roxygen.org}= (fig. \ref{pseudoprime-package}, line
-23).
-
-Furthermore, although \Roxygen{} tags replace many of the structural
-Rd elements such as \verb=\title=, \verb=\keyword=, etc.; stylistic Rd
-elements such as \verb=\emph= and \verb=\email= can be used freely
-within \Roxygen{} tags. See ``Writing R Extensions'' for
-details. \citep[\S2.3 ``Marking text'']{r-core}
-
-\subsection{Fermat Test}
-
-\listing{pseudoprime/R/fermat.R}
- {fermat.R}
- {Roxygen example \texttt{fermat.R}}
- {fermat}
-
-<<echo=false, results=hide>>=
-roxygenize('pseudoprime',
- roxygen.dir='pseudoprime',
- copy.package=FALSE,
- unlink.target=FALSE)
-
-@
-
-When documenting functions (fig. \ref{fermat}), every parameter must
-be documented with a \texttt{@param} tag (line 8); which consists of
-\texttt{@param <variable> <description>}. Similarly, the return value
-must be documented with \texttt{@return <description>} (lines 9-10).
-
-Notice \texttt{@callGraphPrimitives} (line 11): it creates a call
-graph at the default depth similar to figure \ref{fermat-test},
-including primitive functions; \texttt{@callGraph}, on the other hand,
-would exclude primitive functions.\footnote{Note that this feature requires
-package {\tt Rgraphviz} $\geq 1.19.2$, and as of {\tt Roxygen} $0.1-1$
-the {\tt callgraph} feature is not automatically executed; see
-help for {\tt make.callgraph.roclet}.}
-
-\begin{figure}[H]
- \centering
- \includegraphics{pseudoprime/inst/doc/fermat.test-callgraph.pdf}
- \caption{\texttt{fermat.test} call graph with primitives}
- \label{fermat-test}
-\end{figure}
-
-\subsection{Pseudoprime}
-
-\listing{pseudoprime/R/pseudoprime.R}
- {pseudoprime.R}
- {Roxygen example \texttt{pseudoprime.R}}
- {pseudoprime}
-
-Notice the header in \texttt{pseudoprime.R} (fig. \ref{pseudoprime})
-terminated by \texttt{roxygen()}; \texttt{@include fermat.R} (line 1)
-signals that \texttt{fermat.R} should be loaded before
-\texttt{pseudoprime.R}. Roxygen will update
-\texttt{DESCRIPTION} accordingly.
-
-\texttt{@export} (line 15) signifies that \texttt{is.pseudoprime} will
-be added to an export directive in \texttt{NAMESPACE}.
-
-\subsection{Running \Roxygen{}}
-
-Running \texttt{`R CMD roxygen -d pseudoprime'} populates \texttt{man}
-with Rd files, edits \texttt{DESCRIPTION} and \texttt{NAMESPACE}, and
-puts call graphs in \texttt{inst/doc}:
-
-<<echo=false>>=
-roxygenize('pseudoprime',
- roxygen.dir='pseudoprime',
- copy.package=FALSE,
- unlink.target=FALSE)
-
-@
-
-The \texttt{roxygenize} function is an alternative to \texttt{`R CMD
- roxygen'}; see the help page for details.
-
-
-\bibliographystyle{plainnat}
-\bibliography{roxygen}
-\end{document}
+\documentclass{article}
+\usepackage[utf8]{inputenc}
+\usepackage{fancyvrb}
+\usepackage[pdfborder={0 0 0}]{hyperref}
+\usepackage{url}
+\usepackage{upquote}
+\usepackage{graphicx}
+\usepackage{grffile}
+\usepackage{float}
+\usepackage{natbib}
+%% \VignetteIndexEntry{Roxygen Vignette}
+\newcommand{\Roxygen}{\texttt{Roxygen}}
+%% path, filename, caption, label
+\newcommand{\listing}[4]{ %
+ \begin{figure}[H] %
+ \centering %
+ \VerbatimInput[numbers=left, %
+ frame=single, %
+ label=#2]{#1} %
+ \caption{#3} %
+ \label{#4} %
+ \end{figure} %
+}
+\author{Peter Danenberg \url{<pcd at roxygen.org>}}
+\title{\Roxygen{} Vignette}
+\begin{document}
+\maketitle
+\begin{abstract}
+ The purpose of the \Roxygen{} Vignette is to show how to get up and
+ running with \Roxygen{}; for details, including a complete list of
+ tags, consult the help pages or manual for:
+ \begin{itemize}
+ \item \texttt{make.callgraph.roclet}
+ \item \texttt{make.collate.roclet}
+ \item \texttt{make.namespace.roclet}
+ \item \texttt{make.Rd.roclet}
+ \end{itemize}
+\end{abstract}
+\tableofcontents
+\section{Minimal Example: ``Hello, Roxygen!''}
+
+\listing{hello-roxygen.R}
+ {hello-roxygen.R}
+ {Roxygen sanity-check}
+ {hello-roxygen}
+
+\texttt{hello-roxygen.R} (fig. \ref{hello-roxygen}) is a minimal
+example to check the sanity of your \Roxygen{} installation. It merely
+replaces the package description so that `\texttt{R CMD check}' will
+run after \Roxygen{} has processed the package skeleton.
+
+First, create the package skeleton:
+<<keep.source=true>>=
+library(roxygen)
+package.skeleton('helloRoxygen',
+ code_files='hello-roxygen.R',
+ force=TRUE)
+@
+<<echo=false, results=hide>>=
+roxygenize('helloRoxygen',
+ roxygen.dir='helloRoxygen',
+ copy.package=FALSE,
+ unlink.target=FALSE)
+@
+then, run \Roxygen{} on the new directory:
+
+\begin{quote}
+ \texttt{R CMD roxygen -d helloRoxygen}.
+\end{quote}
+
+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.
+
+\section{Example: Pseudoprimality}
+
+\subsection{Package Description}
+
+\listing{pseudoprime/R/pseudoprime-package.R}
+ {pseudoprime-package.R}
+ {Package description for \texttt{pseudoprime}}
+ {pseudoprime-package}
+
+One could imagine, for instance, a less trivial package that actually
+does something; enter \texttt{pseudoprime}, a toy that tests for
+primes using Fermat's little
+theorem.\footnote{\href{http://en.wikipedia.org/wiki/Fermat\%27s_little_theorem}{http://en.wikipedia.org/wiki/Fermat\textquotesingle s\_little\_theorem}}
+
+A package description has been provided in figure
+\ref{pseudoprime-package}; notice the \texttt{roxygen()} statement in
+line 30: each \Roxygen{} description block must be followed by a
+statement, even header material that describes a file or package in
+lieu of a specific function. \texttt{roxygen()} is provided as a
+\texttt{NOOP} (null statement) to stand in for such cases.
+
+The first sentence of any \Roxygen{} block briefly describes its
+object; and may be followed directly by a \Roxygen{} tag
+(fig. \ref{hello-roxygen}, line 2) or a more detailed description
+(fig. \ref{pseudoprime-package}, line 3). The detailed description
+begins after the intervening blank line, and continues until the first
+\Roxygen{} tag (fig. \ref{pseudoprime-package}, line 19).
+
+Each \Roxygen{} tag begins with an asperand, like \texttt{@name},
+\texttt{@author}, etc.; which means, incidentally, that all real
+asperands have to be escaped with a double-asperand, as in
+\verb=\email{pcd@@roxygen.org}= (fig. \ref{pseudoprime-package}, line
+23).
+
+Furthermore, although \Roxygen{} tags replace many of the structural
+Rd elements such as \verb=\title=, \verb=\keyword=, etc.; stylistic Rd
+elements such as \verb=\emph= and \verb=\email= can be used freely
+within \Roxygen{} tags. See ``Writing R Extensions'' for
+details. \citep[\S2.3 ``Marking text'']{r-core}
+
+\subsection{Fermat Test}
+
+\listing{pseudoprime/R/fermat.R}
+ {fermat.R}
+ {Roxygen example \texttt{fermat.R}}
+ {fermat}
+
+<<echo=false, results=hide>>=
+roxygenize('pseudoprime',
+ roxygen.dir='pseudoprime',
+ copy.package=FALSE,
+ unlink.target=FALSE)
+
+@
+
+When documenting functions (fig. \ref{fermat}), every parameter must
+be documented with a \texttt{@param} tag (line 8); which consists of
+\texttt{@param <variable> <description>}. Similarly, the return value
+must be documented with \texttt{@return <description>} (lines 9-10).
+
+Notice \texttt{@callGraphPrimitives} (line 11): it creates a call
+graph at the default depth similar to figure \ref{fermat-test},
+including primitive functions; \texttt{@callGraph}, on the other hand,
+would exclude primitive functions.\footnote{Note that this feature requires
+package {\tt Rgraphviz} $\geq 1.19.2$, and as of {\tt Roxygen} $0.1-1$
+the {\tt callgraph} feature is not automatically executed; see
+help for {\tt make.callgraph.roclet}.}
+
+\begin{figure}[H]
+ \centering
+ \includegraphics{pseudoprime/inst/doc/fermat.test-callgraph.pdf}
+ \caption{\texttt{fermat.test} call graph with primitives}
+ \label{fermat-test}
+\end{figure}
+
+\subsection{Pseudoprime}
+
+\listing{pseudoprime/R/pseudoprime.R}
+ {pseudoprime.R}
+ {Roxygen example \texttt{pseudoprime.R}}
+ {pseudoprime}
+
+Notice the header in \texttt{pseudoprime.R} (fig. \ref{pseudoprime})
+terminated by \texttt{roxygen()}; \texttt{@include fermat.R} (line 1)
+signals that \texttt{fermat.R} should be loaded before
+\texttt{pseudoprime.R}. \Roxygen{} will update
+\texttt{DESCRIPTION} accordingly.
+
+\texttt{@export} (line 15) signifies that \texttt{is.pseudoprime} will
+be added to an export directive in \texttt{NAMESPACE}.
+
+\subsection{Running \Roxygen{}}
+
+Running \texttt{`R CMD roxygen -d pseudoprime'} populates \texttt{man}
+with Rd files, edits \texttt{DESCRIPTION} and \texttt{NAMESPACE}, and
+puts call graphs in \texttt{inst/doc}:
+
+<<echo=false>>=
+roxygenize('pseudoprime',
+ roxygen.dir='pseudoprime',
+ copy.package=FALSE,
+ unlink.target=FALSE)
+
+@
+
+The \texttt{roxygenize} function is an alternative to \texttt{`R CMD
+ roxygen'}; see the help page for details.
+
+
+\bibliographystyle{plainnat}
+\bibliography{roxygen}
+\end{document}
More information about the Roxygen-commits
mailing list