Description Usage Arguments Value Examples
This function sets the defined_as
field in a SymbolMap
entry.
1 | set_defined_as(map, name, type, is_parameter = FALSE)
|
map |
(SymbolMap) A map to modify. |
name |
(character) The symbol whose entry should be modified. |
type |
(Term | formula) The new 'defined as' type. Formulas are
automatically converted to types with |
is_parameter |
(logical) Is this symbol a parameter? |
The updated SymbolMap
.
1 2 3 4 5 6 7 8 9 10 | map = SymbolMap()
# Set 'x' defined as an Integer.
map = set_defined_as(map, "x", RInteger)
# Set 'length' defined as a function from ANY to Numeric.
#
# Type variables in the type indicate polymorphism. In this example, 'b' can
# be replaced by any type at each call site for 'length'.
map = set_defined_as(map, "length", b ~ RNumeric)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.