-
Notifications
You must be signed in to change notification settings - Fork 7
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
Room2: apply vaccine script added #8
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general it's a nicely written function, but with no docs it's hard to follow.
@@ -0,0 +1,16 @@ | |||
apply_vaccine_to_population <- function(population, ndoses, threshold_age) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add (roxygen) documentation to this function
apply_vaccine_to_population <- function(population, ndoses, threshold_age) { | ||
for (individual in population) { | ||
if (ndoses > 0) { | ||
if (indiv["age"] > threshold_age || indiv["isAtRisk"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably you meant individual
here
inject_first_jab(indiv) | ||
} | ||
} | ||
ndoses <- ndoses - 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should check max/min values of ndoses
for (individual in population) { | ||
if (ndoses > 0) { | ||
if (indiv["age"] > threshold_age || indiv["isAtRisk"]) { | ||
if (indiv["hasFirstJab"]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should consider all the cases in that condition
No description provided.