View source: R/distributions.r
rconstant | R Documentation |
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.
rconstant(n, constant)
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. |
Returns a vector of length n
with the same type as constant
.
Robin Denz
library(simDAG)
rconstant(n=10, constant=7)
rconstant(n=4, constant="Male")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.