[R-gregmisc-users] SF.net SVN: r-gregmisc: [1258] trunk/gtools
Brought to you by:
warnes
From: <wa...@us...> - 2008-04-12 19:19:49
|
Revision: 1258 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1258&view=rev Author: warnes Date: 2008-04-12 12:19:45 -0700 (Sat, 12 Apr 2008) Log Message: ----------- assert() is now deprecated in favor of base::stopifnot() Modified Paths: -------------- trunk/gtools/NEWS Added Paths: ----------- trunk/gtools/man/assert-deprecated.R trunk/gtools/man/gtools-deprecated.Rd Removed Paths: ------------- trunk/gtools/man/assert.Rd Modified: trunk/gtools/NEWS =================================================================== --- trunk/gtools/NEWS 2008-04-12 19:19:05 UTC (rev 1257) +++ trunk/gtools/NEWS 2008-04-12 19:19:45 UTC (rev 1258) @@ -1,3 +1,9 @@ +gtools SVN VERSION $Id$ +----------------------- + +- Modify odd() and even() to use modulus operator instead of division. + (Doesn't seem to change the results, but looks more elegant!) + gtools 2.4.0 ------------ Copied: trunk/gtools/man/assert-deprecated.R (from rev 1256, trunk/gtools/man/assert.Rd) =================================================================== --- trunk/gtools/man/assert-deprecated.R (rev 0) +++ trunk/gtools/man/assert-deprecated.R 2008-04-12 19:19:45 UTC (rev 1258) @@ -0,0 +1,49 @@ +\name{assert-deprecated} +\alias{assert-deprecated} +\alias{assert} +\title{DEPRECATED: Generate an error if an expression is not true.} +\description{ + Generate an error if an expression is not true. +} +\note{ + This function is deprecated in favor of \code{\link[base]{stopifnot}} +} +\usage{ +assert(FLAG) +} +\arguments{ + \item{FLAG}{ Expression that should evaluate to a boolean vector} +} +\details{ + Assert generate an error if its aregument does not evaluate to + boolean (vector) containing only \code{TRUE} values. This is useful + for defensinve programming as it provides a mechanism for checking + that certain facts, the 'assertions', do in fact hold. Checking of + 'assertions' is an important tool in the development of robust program + code. +} +\value{ + None. Evaluated only for its side effect. +} +\author{Gregory R. Warnes \email{wa...@bs...} } +\seealso{ + \code{\link[base]{stopifnot}}, \code{\link[base]{stop}}, + \code{\link[base]{warning}} +} +\examples{ + +## Trivial example +posSqrt <- function(x) + { + assert(x>=0) + sqrt(x) + } + +posSqrt(1:10) # works fine, no messages +\dontrun{ +posSqrt(-5:5) # generates an error, since the asssertion is not met +} + + +} +\keyword{programming} Deleted: trunk/gtools/man/assert.Rd =================================================================== --- trunk/gtools/man/assert.Rd 2008-04-12 19:19:05 UTC (rev 1257) +++ trunk/gtools/man/assert.Rd 2008-04-12 19:19:45 UTC (rev 1258) @@ -1,42 +0,0 @@ -\name{assert} -\alias{assert} -\title{Generate an error if an expression is not true.} -\description{ - Generate an error if an expression is not true. -} -\usage{ -assert(FLAG) -} -\arguments{ - \item{FLAG}{ Expression that should evaluate to a boolean vector} -} -\details{ - Assert generate an error if its aregument does not evaluate to - boolean (vector) containing only \code{TRUE} values. This is useful - for defensinve programming as it provides a mechanism for checking - that certain facts, the 'assertions', do in fact hold. Checking of - 'assertions' is an important tool in the development of robust program - code. -} -\value{ - None. Evaluated only for its side effect. -} -\author{Gregory R. Warnes \email{wa...@bs...} } -\seealso{ \code{\link[base]{stop}}, \code{\link[base]{warning}} } -\examples{ - -## Trivial example -posSqrt <- function(x) - { - assert(x>=0) - sqrt(x) - } - -posSqrt(1:10) # works fine, no messages -\dontrun{ -posSqrt(-5:5) # generates an error, since the asssertion is not met -} - - -} -\keyword{programming} Added: trunk/gtools/man/gtools-deprecated.Rd =================================================================== --- trunk/gtools/man/gtools-deprecated.Rd (rev 0) +++ trunk/gtools/man/gtools-deprecated.Rd 2008-04-12 19:19:45 UTC (rev 1258) @@ -0,0 +1,24 @@ +\name{gtools-deprecated} +\alias{gtools-deprecated} +\alias{assert} +\title{Deprecated Functions in the gtools package} +\description{ + These functions are provided for compatibility with older versions of + gtools, and may be defunct as soon as the next release. +} +\usage{ +assert(FLAG) +} +\arguments{ + \item{FLAG}{ Expression that should evaluate to a boolean vector} +} +\details{ + The original help page for these functions is often + available at \code{help("oldName-deprecated")} (note the quotes). + + \code{assert} is a deprecated synonym for \code{\link[base]{stopifnot}}. +} +\seealso{ + \code{\link{Deprecated}}, \code{\link{gtools-defunct}} +} +\keyword{misc} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |