add_deprecated_call: Add '.Deprecated()' to Text

View source: R/modify_roxygen2.R

add_deprecated_callR Documentation

Add .Deprecated() to Text

Description

.Deprecated() is added after each function declaration in the text. Note that it does not check for an existing .Deprecated().

Usage

add_deprecated_call(text, new = NULL)

Arguments

text

Character vector containing function declarations.

new

(Optional) Argument passed to the new call to .Deprecated().

See Also

str_replace

Other modify roxygen2 documentation functions: add_deprecated_to_desc()

Examples

library(tidyverse)

# Adds after each function declaration
add_deprecated_call("sample_function1 <-\nfunction(a,b,c){}\n\n#' Roxygen2 Documentation\n#' Roxygen2 Lines\n\nsample_function2 <- \nfunction(x,y,z){}")

# Does not skip function declarations that already makes a call to the .Deprecated function
add_deprecated_call("sample_function1 <-\nfunction(a,b,c){\n.Deprecated()\n}\n\n#' Roxygen2 Documentation\n#' Roxygen2 Lines\n\nsample_function2 <- \nfunction(x,y,z){}")

# Text can be a vector of length greater than 1
add_deprecated_call(c("sample_function1 <-\nfunction(a,b,c){\n.Deprecated()\n}", "#' Roxygen2 Documentation\n#' Roxygen2 Lines\n\nsample_function2 <- \nfunction(x,y,z){}"))

meerapatelmd/suzyBakeOven documentation built on March 30, 2022, 1:44 p.m.