Changed "rbinom(10" to "rbinom(n()" to improve the code and make sure that it doesnt break when you use a different dataset.
People reading the book might to try your code on their dataset. They might get stuck at this part. With "n()" there is a good alternative to hardcoding "10". I am not completely sure that it does not have sideeffects - so better do a thorough check before you adopt the pull request.
Agreed, this is better. It has the benefit you mention, but the bigger thing is that it's more maintainable for us (I wouldn't say we're trying to maximize the copy-pastability of the code)
Changed "rbinom(10" to "rbinom(n()" to improve the code and make sure that it doesnt break when you use a different dataset.
People reading the book might to try your code on their dataset. They might get stuck at this part. With "n()" there is a good alternative to hardcoding "10". I am not completely sure that it does not have sideeffects - so better do a thorough check before you adopt the pull request.