Learn R Programming

WoodSimulatR (version 0.6.2)

simulate_conditionally: Add simulated values to a dataset conditionally, based on a simbase_* object

Description

Add simulated values to a dataset conditionally, based on a simbase_* object

Usage

simulate_conditionally(data, simbase, force_positive = TRUE, ...)

Value

The modified dataset data with simulated values.

Arguments

data

The dataset where simulated values are added to. The dataset has to contain at least one variable which is also included in the simbase_* object.

simbase

Basic data object for the simulation, as calculated e.g. by simbase_covar() or simbase_list().

force_positive

If TRUE, the resulting values are forced to be \(\ge 0\).

...

further arguments passed to or from other methods.

Details

Given a simbase_* object, this function adds simulated values to a dataset, conditional on the values of some of the variables already contained in the dataset.

Examples

Run this code
# add simulated tension data based on a simbase stored in WoodSimulatR
dataset <- data.frame(E_dyn = rnorm(n = 100, mean = 12500, sd = 2200));
dataset_t <- simulate_conditionally(dataset, ws_t)

# add simulated bending data
dataset_be <- simulate_conditionally(dataset, ws_be)

Run the code above in your browser using DataLab