R/aka.R
aka.Rd
When a function or object is renamed, the link to its original
help page is lost in R. Using aka()
(also known as) with correct alias=
allows to keep track of the original help page and get it with .?obj
.
Moreover, one can also populate a short man page with description, seealso and example or add a short comment message that is displayed at the
same time in the R console.
An R object.
The full qualified name of the alias object whose help
page should be retained as pkg::name
. If NULL
(by default), use obj
.
A comment to place in obj
(will also be printed when calling
.?obj
).
A description of the function for the sort man page.
A character string of functions in the form fun
or pkg::fun
.
A character string with code for a short example.
An http or https URL pointing to the help page for the function on the Internet.
An aka object
The type of hyperlink supported. The default value
should be ok. Use "none"
to suppress hyperlink, "href"
for http(s)://
link that opens a web page, or "help"
in RStudio to open the corresponding
help page in the Help tab.
Further arguments (not used yet)
An aka object
The original obj
with the comment
attribute set or replaced with
comment =
plus a src
attribute set to alias =
and description
,
seealso
, example
, and url
attributes also possibly populated. If the
object is a function, its class becomes aka and function.
# Say you prefer is.true() similar to is.na() or is.null()
# but R provides isTRUE().
library(svMisc)
# Also defining a short man page
is.true <- aka(isTRUE, description = "Check if an object is TRUE.",
seealso = c("is.false", "logical"), example = c("is.true(TRUE)", "is.true(FALSE)", "is.true(NA)"))
# This way, you still got access to the right help page for is.true()
if (FALSE) { # \dontrun{
.?is.true
} # }