Description Usage Arguments Value Author(s) References See Also Examples
add_option
adds a option to a prexisting
OptionParser
instance whereas make_option
is used to create a list of OptionParserOption
instances that will be used in the option_list
argument of the OptionParser
function to create a
new OptionParser
instance.
1 2 3 4 5 6 |
object |
An instance of the |
opt_str |
A character vector containing the string of the desired long flag comprised of “–” followed by a letter and then a sequence of alphanumeric characters and optionally a string of the desired short flag comprised of the “-” followed by a letter. |
action |
A character string that describes the
action |
type |
A character string that describes specifies
which data type should be stored, either
“logical”, “integer”, “double”,
“complex”, or “character”. Default is
“logical” if |
dest |
A character string that specifies what field
in the list returned by |
default |
The default value |
help |
A character string describing the option to
be used by |
metavar |
A character string that stands in for the
option argument when printing help text. Default is the
value of |
Both make_option
and add_option
return
instances of class OptionParserOption
.
Trevor Davis.
Python's optparse
library, which inspires this
package, is described here:
http://docs.python.org/library/optparse.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | make_option("--longflag")
make_option(c("-l", "--longflag"))
make_option("--integer", type="integer", default=5)
make_option("--integer", default=as.integer(5)) # same as previous
# examples from package vignette
make_option(c("-v", "--verbose"), action="store_true", default=TRUE,
help="Print extra output [default]")
make_option(c("-c", "--count"), type="integer", default=5,
help="Number of random normals to generate [default %default]",
metavar="number")
make_option("--generator", default="rnorm",
help = "Function to generate random deviates [default \"%default\"]")
make_option("--mean", default=0,
help="Mean if generator == \"rnorm\" [default %default]")
make_option("--sd", default=1, metavar="standard deviation",
help="Standard deviation if generator == \"rnorm\" [default %default]")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.