I have an input data set, which may look something like this:
DF=data.frame(
Variable = c("Test1", "Test2", "Test3"),
Distribution = c("Normal", "Exponential","Poisson"),
Variable = c(2, 3, 4),
SD = c(2, NA, NA))
I want to use the random probability functions (e.g. rnorm rexp and rbinom) using the distributions given in the data frame DF.
So, how do I turn the text input into the correct functions?
I want to use the corresponding values in the Variable and SD columns as the mean values/standard deviations if appropriate.
DFdoesn't have (eg.,size,n). How do you think dealing with that?nwhich for arguments sake say will be 10 for all distributions. TheVariablecolumn will be the mean for the Normal distribution, rate for Exponential, and lambda for Poisson. Should have everything.