Vector: Vector Class

VectorR Documentation

Vector Class

Description

An element that defines a constant vector

Super class

biorisk::RiskElement -> Vector

Public fields

values

The values of the vector

n

Length of the vector

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage
Vector$new(name, values, output_unit = NA)
Arguments
name

A character defining the name for the element

values

A vector of values for the vector

output_unit

A character with the unit of the output

Returns

A new instance of the element


Method simulate()

Make simulation. Returns the vector saved in the class. If the length is different from niter, it raises an error.

Usage
Vector$simulate(niter, check_units = FALSE)
Arguments
niter

Number of iterations (length of the vector).

check_units

Ignored.


Method simulate_level()

Simulation at some level for X-D Monte Carlo

Usage
Vector$simulate_level(niter0, iter1 = 1, level = 0)
Arguments
niter0

Number of iterations at the lower level

iter1

Iteration at the upper level

level

Level of the calculation (ignored, it always returns a vector to facilitate the mutates)


Method clone()

The objects of this class are cloneable with this method.

Usage
Vector$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


albgarre/biorisk documentation built on Feb. 23, 2025, 5:19 a.m.