rconstant {simDAG} | R Documentation |
Use a single constant value for a root node
Description
This is a small convenience function that simply returns the value passed to it, in order to allow the use of a constant node as root node in the sim_from_dag
function.
Usage
rconstant(n, constant)
Arguments
n |
The number of times the constant should be repeated. |
constant |
A single value of any kind which is used as the only value of the resulting variable. |
Value
Returns a vector of length n
with the same type as constant
.
Author(s)
Robin Denz
Examples
library(simDAG)
rconstant(n=10, constant=7)
rconstant(n=4, constant="Male")
[Package simDAG version 0.1.2 Index]