max_length | R Documentation |
A base class in the struct package. Not normally called directly. An entity object is used to store information about a parameter or output_ The standard 'name','description' and 'type' slots are included, along with 'value' for storing the value of the parameter and 'max_length' for restricting the length of 'value' if needed.
max_length(obj)
entity(
name,
description = character(0),
type = "character",
value = NULL,
max_length = Inf,
...
)
## S4 method for signature 'entity'
value(obj)
## S4 replacement method for signature 'entity'
value(obj) <- value
## S4 method for signature 'entity'
max_length(obj)
## S4 replacement method for signature 'entity'
max_length(obj) <- value
obj |
An entity object |
name |
the name of the object |
description |
a description of the object |
type |
the type of the struct object |
value |
The value of the parameter/outputs |
max_length |
Maximum length of value vector (default 1) |
... |
additional inputs to the struct_class object |
Entity objects are usually defined in the prototype of another object, but
can be extracted using param_obj
and output_obj
.
max value vector length for an entity
An entity object
# Create a new entity object
E = entity(
name = 'example',
description = 'this is an example',
type = 'numeric',
value = 1
)
# Get/set the value of the entity object
value(E)
value(E) = 10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.