usage | R Documentation |
Get a usage template for a function from within the function. If you encounter misguided usage, you can display the template.
usage(n = -1, usage = FALSE)
n |
A negative integer giving the number of from to frames/environments
to go back (passed as |
usage |
Give this functions usage (as a usage example ...) and exit? |
A character string giving the Usage as help
would do.
# usage with assignment operator:
foo <- function(x) {
u <- usage()
message("Usage is: ", u)
}
foo()
# usage without assignment operator:
bar <- function(x) {
message(usage(n = -2))
}
bar()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.