aka | R Documentation |
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.
aka(
obj,
alias = NULL,
comment = "",
description = NULL,
seealso = NULL,
example = NULL,
url = NULL
)
## S3 method for class 'aka'
print(
x,
hyperlink_type = getOption("hyperlink_type", default = .hyperlink_type()),
...
)
## S3 method for class 'aka'
str(object, ...)
obj |
An R object. |
alias |
The full qualified name of the alias object whose help
page should be retained as |
comment |
A comment to place in |
description |
A description of the function for the sort man page. |
seealso |
A character string of functions in the form |
example |
A character string with code for a short example. |
url |
An http or https URL pointing to the help page for the function on the Internet. |
x |
An aka object |
hyperlink_type |
The type of hyperlink supported. The default value
should be ok. Use |
... |
Further arguments (not used yet) |
object |
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()
## Not run:
.?is.true
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.