max_length {struct} | R Documentation

## get the max value vector length for an entity

### Description

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.

### Usage

    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

### Arguments

`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)

### Details

Entity objects are usually defined in the prototype of another object, but can be extracted using `param_obj` and `output_obj`.

### Value

max value vector length for an entity

An entity object

### Examples

    # 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

[Package struct version 1.2.0 Index]