Mark Objects as Deprecated

DESCRIPTION:

A deprecated object should call this function to generate a warning message and suggest a replacement function, if one exists. An object that is going to be removed from S-PLUS is typically first deprecated.

USAGE:

.Deprecated(new, package=NULL, deprecatedFunName=NULL)

OPTIONAL ARGUMENTS:

new
a character string. The name of a suggested replacement function.
package
a characted string. The name of the package to use when suggesting where the deprecated function might be listed.
deprecatedFunName
a character string. The name of the deprecated function. If not specified, the value of sys.call(sys.parent)) will be used.

DETAILS:

A call to .Deprecated is typically added to a function that is being deprecated.

By default, every call to a deprecated function that calls .Deprecated produces a warning message. This can be controlled by the value of options("deprecated.warn"). Possible values are:
   -1 => no warning
    0 or NULL => always warn (the default)
    1 => warn only once in a session

This function emulates the R function .Deprecated, but the S-PLUS version includes a new argument, deprecatedFunName. Also, the option "deprecated.warn" controls the frequency of the warning messages as described previously.

SEE ALSO:

and .

EXAMPLES:

zlog <- function(x)
{
        .Deprecated(new = "zslog", deprecatedFunName = "zlog")
        sum(log(x))
}
zlog(1:5)
# [1] 4.787492
# Warning messages:
#   'zlog' is deprecated.
#        Use 'zslog' instead.
#        See help("Deprecated") in: zlog(1:5)