update_block: Block-oriented state updates for vectorized models

View source: R/updates.R

update_blockR Documentation

Block-oriented state updates for vectorized models

Description

Many models generate multivariate outputs (e.g., SBP/DBP or lab panels). update_block() validates a named payload against an entity's schema and a named schema block, then returns a named list of per-variable state updates for use as a transition() return value.

Usage

update_block(
  entity,
  block,
  values,
  require_all = TRUE,
  unknown = c("error", "drop_warn_once", "drop_warn_always")
)

Arguments

entity

A Entity object.

block

Block name (character scalar) corresponding to schema$blocks.

values

Named vector or named list of values to update. Names must correspond to state variables in the entity's schema.

require_all

Logical; if TRUE (default) all variables belonging to block must be supplied in values.

unknown

Policy for variables supplied in values that are not present in the entity's schema. One of "error" (default), "drop_warn_once", or "drop_warn_always".

Value

A named list of state updates suitable for returning from transition(). Values are returned in schema block order.


fluxCore documentation built on Sept. 22, 2026, 5:07 p.m.