simulate_conditionally: Add simulated values to a dataset conditionally, based on a...

View source: R/statistical_simulation.r

simulate_conditionallyR Documentation

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, ...)

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 ≥ 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.

Value

The modified dataset data with simulated values.

Examples

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


WoodSimulatR documentation built on June 20, 2022, 9:05 a.m.