Skip to content

Commit

Permalink
fix: resolves issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDenz1 committed Feb 28, 2024
1 parent 814c213 commit ea02098
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
* dag2matrix() now returns a numeric matrix even if the dag object contains only root nodes
* node() and node_td() now support character vectors in the 'name' argument, allowing easy creation of multiple nodes with the same definition
* Add sim_n_datasets() function
* Fix Bug in node_time_to_event() function that lead to the `immunity_duration` parameter being used incorrectly
3 changes: 1 addition & 2 deletions R/node_time_to_event.r
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ node_time_to_event <- function(data, parents, sim_time, name,
event_prob <- fifelse(is.na(data[[name_time]]), event_prob,
fifelse(data[[name_event]] &
days_since_event < event_duration, 1,
fifelse(data[[name_event]] &
days_since_event < immunity_duration, 0,
fifelse(days_since_event < immunity_duration, 0,
event_prob)))

# draw new events based on this probability
Expand Down

0 comments on commit ea02098

Please sign in to comment.