foo | R Documentation |
A simple function to demonstrate how functions work.
foo( x, case = c("lower", "upper", "sentence"), spacing = 0, add = NULL, ignore = stop("STOP THIS MADNESS!") )
x |
character vector |
case |
case that |
spacing |
integer specifying character spacing in |
add |
(optional) text added before each string |
ignore |
ignored argument |
This is a not so simple function that does a simple task: given a character string it can change its case and character spacing, as well as add some text in front of it.
A character string composed of added
text and x
.
The purpose of this function is to demonstrate how functions work.
foo
has four arguments.
The first has no default and the function will throw an error if it is not supplied.
The second has three possible values that can be partially matched and the first one is the default.
The third has a default but can be set to any value, possibly generating warnings.
The fourth is optional and defaults to NULL
.
The fifth is not evaluated at all.
foo("bar", case = "sentence", spacing = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.