View source: R/make.functions.R
make.categorical.draw | R Documentation |
Create a function that makes draws from a categorical distribution. Function calls sample(x=inheritances,size=1,prob=weights)
make.categorical.draw(inheritances, weights)
inheritances |
A vector of inheritance probabilities |
weights |
A vector of weights for each inheritance probability |
A function that makes draws from a categorical distribution.
set.seed(17)
inher_func<-make.categorical.draw(inheritances=c(0.25,0.50,0.75),weights=c(0.25,0.5,0.25))
net<-sim.bdh.age(1,1,5,2,1,c(1/3,1/3,1/3),hyb.inher.fxn = inher_func,
complete=TRUE)[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.