Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 03-counterfactuals.qmd #245

Merged
merged 3 commits into from
Jun 20, 2024
Merged

Conversation

jakobschumacher
Copy link
Contributor

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.

jakobschumacher and others added 3 commits June 20, 2024 10:16
Changed "rbinom(10" to "rbinom(n()" to improve the code and make sure that it doesnt break when you use a different dataset
@malcolmbarrett
Copy link
Collaborator

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)

@malcolmbarrett malcolmbarrett merged commit a4edc6c into r-causal:main Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants