-
Notifications
You must be signed in to change notification settings - Fork 42
how to deprecate functions
Parent: Developer
From the users' point of view, oce
uses the bioconductor system for removing functions. From the developers' point of view, the steps are as follows.
-
The developers come to an agreement on whether to remove the function. This decision is not taken lightly, and it can take days to make a decision. The main arguments in favour of removing a function are that (a) it is deficient in a way that is troublesome to users and that would be difficult to rectify, (b)
oce
offers a superior alternative, (c) the function is "stale," not having been used by the developers or (as signalled by issue reports) by users and (d) the function does not match a design pattern that is favoured inoce
. Of these, the last is the weakest argument, although it is always considered carefully, because it helps to maintain the usability ofoce
, generally. -
The function is "deprecated". This has three components.
-
Its documentation is altered.
- The token
[deprecated]
is placed at the end of the title. - A warning is put at the start of the description. It can help to use a form similar to that used in other functions within
oce
, e.g. the deprecation warning foroce.as.POSIXlt()
reads:\strong{WARNING:} This function will be removed soon; see \link{oce-deprecated}. Use \code{\link[lubridate]{parse_date_time}} in the \CRANpkg{lubridate) package instead.
- The
@family
token that relates this to other functions is removed, as are other links to the function. (This is so that new users won't see discover it as easily.) - a
@family
token about deprecation is inserted. This reads#' @family functions that will be removed soon
(it must read exactly as shown, for the Roxygen parser to bind together the instances)
- The token
-
A call to
.Deprecated()
is made at the start of the function. For example, the call used inoce.as.POSIXlt()
reads as follows:.Deprecated("lubridate::parse_date_time",msg="oce.as.POSIXlt() will be removed soon; use lubridate::parse_date_time() instead. See ?'oce-deprecated'.")
-
A note is added to the documentation item
oce-deprecated
(inR/oce.R
). (This should include the date.)
-
-
After the next CRAN release, the source code moves to the "defunct" status. The steps are similar to the above; see the code for examples.