Skip to content

Commit

Permalink
Improve calculation of lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Feb 20, 2024
1 parent 2732d67 commit 70a908a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/epichains.R
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ summary.epichains_tree <- function(object, ...) {
} else {
# Length: each case's last sim_id
for (i in seq_len(index_cases)) {
max_case_index <- max(which(object$infectee_id == i))
chain_summaries[i] <- object$sim_id[max_case_index]
index_case_rows <- which(object$infector_id == i)
chain_summaries[i] <- length(unique((object$sim_id[index_case_rows])))
}
}

Expand Down

0 comments on commit 70a908a

Please sign in to comment.