vetr_settings | R Documentation |
Utility function to generate setting values. We strongly recommend
that you generate the settings outside of function calls so that setting
generation does not become part of the vet/vetr/alike
evaluation as
that could add noticeable overhead to the function evaluation.
vetr_settings(
type.mode = 0L,
attr.mode = 0L,
lang.mode = 0L,
fun.mode = 0L,
rec.mode = 0L,
suppress.warnings = FALSE,
fuzzy.int.max.len = 100L,
width = -1L,
env.depth.max = 65535L,
symb.sub.depth.max = 65535L,
symb.size.max = 15000L,
nchar.max = 65535L,
track.hash.content.size = 63L,
env = NULL,
result.list.size.init = 64L,
result.list.size.max = 1024L
)
type.mode |
integer(1L) in 0:2, defaults to 0, determines how object
types (as in
|
attr.mode |
integer(1L) in 0:2, defaults to 0, determines strictness of attribute comparison:
|
lang.mode |
integer(1L) in 0:1, defaults to 0, controls language
matching, set to |
fun.mode |
NOT IMPLEMENTED, controls how functions are compared |
rec.mode |
integer(1L) |
suppress.warnings |
logical(1L) suppress warnings if TRUE |
fuzzy.int.max.len |
max length of numeric vectors to consider for
integer likeness (e.g. |
width |
to use when deparsing expressions; default |
env.depth.max |
integer(1L) maximum number of nested environments to recurse through, defaults to 65535L; these are tracked to make sure we do not get into an infinite recursion loop, but because they are tracked we keep a limit on how many we will go through, set to -1 to allow unlimited recursion depth. You should not need to change this unless you are running into the recursion limit. |
symb.sub.depth.max |
integer(1L) maximum recursion depth when recursively substituting symbols in vetting expression, defaults to 65535L |
symb.size.max |
integer(1L) maximum number of characters that a symbol is allowed to have in vetting expressions, defaults to 15000L. |
nchar.max |
integer(1L) defaults to 65535L, threshold after which
strings encountered in C code are truncated. This is the read limit. In
theory |
track.hash.content.size |
integer(1L) (advanced) used to set the initial size of the symbol tracking vector used with the hash table that detects recursive symbol substitution. If the tracking vector fills up it will be grown by 2x. This parameter is exposed mostly for developer use. |
env |
what environment to use to match calls and evaluate vetting
expressions, although typically you would specify this with the |
result.list.size.init |
initial value for token tracking. This will be
grown by a factor of two each time it fills up until we reach
|
result.list.size.max |
maximum number of tokens we keep track of, intended mostly as a safeguard in case a logic error causes us to keep allocating memory. Set to 1024 as a default value since it should be exceedingly rare to have vetting expressions with such a large number of tokens, enough so that if we reach that number it is more likely something went wrong. |
Settings after fuzzy.int.max.len
are fairly low level and exposed mostly
for testing purposes. You should generally not need to use them.
Note that a successful evaluation of this function does not guarantee a
correct settings list. Those checks are carried out internally by
vet/vetr/alike
.
list with all the setting values
type_alike
, alike
, vetr
type_alike(1L, 1.0, settings=vetr_settings(type.mode=2))
## better if you are going to re-use settings to reduce overhead
set <- vetr_settings(type.mode=2)
type_alike(1L, 1.0, settings=set)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.