Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

deprecation-utilities

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

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


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.

statnet.common

Common R Scripts and Utilities Used by the Statnet Project Software

v4.4.1
GPL-3 + file LICENSE
Authors
Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Skye Bender-deMoll [ctb]
Initial release
2020-10-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.