Putting everything together

Now that we have done the hard work of creating all our simulation functions, we can just assemble them inside a general function that will use them to easily simulate the data for us. The first thing we note is that there are a lot of parameters that we need to control, and if we create a function signature that contains all of these parameters explicitly, we will be constraining ourselves by having a rigid signature that is hard to work with. We don't want to deal with these parameters by hand because it will make it cumbersome to work with the code. What if we could pass a single parameter that would mutate for us as we require? Well, we can do that! Parameter objects exist for this reason. They are a simple ...

Get R Programming By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.