R: Utilities to help with deprecating functions.

deprecation-utilities {statnet.common} | R Documentation

## Utilities to help with deprecating functions.

### Description

`.Deprecate_once` calls `.Deprecated()`, passing all its arguments through, but only the first time it's called.

`.Deprecate_method` calls `.Deprecated()`, but only if a method has been called by name, i.e., `METHOD.CLASS`. Like `.Deprecate_once` it only issues a warning the first time.

### Usage

    .Deprecate_once(...)

    .Deprecate_method(generic, class)

### Arguments

`...` | arguments passed to `.Deprecated()`.
`generic, class` | strings giving the generic function name and class name of the function to be deprecated.

### Examples

    ## Not run:
    options(warn=1) # Print warning immediately after the call.
    f <- function(){
       .Deprecate_once("new_f")
    }
    f() # Deprecation warning
    f() # No deprecation warning

    ## End(Not run)
    ## Not run:
    options(warn=1) # Print warning immediately after the call.
    summary.packageDescription <- function(object, ...){
       .Deprecate_method("summary", "packageDescription")
       invisible(object)
    }

    summary(packageDescription("statnet.common")) # No warning.
    summary.packageDescription(packageDescription("statnet.common")) # Warning.
    summary.packageDescription(packageDescription("statnet.common")) # No warning.

    ## End(Not run)

[Package statnet.common version 4.6.0 Index]