Skip to content

Commit

Permalink
Fix aggregate arg
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Dec 15, 2023
1 parent 9e180ae commit ab24408
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/epichains.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ summary(simulate_summary_eg)

### Aggregating

You can aggregate `<epichains>` objects returned by the `simulate_*()` functions into a time series, which is a `<data.frame>` with columns "cases" and either "generation" or "time", depending on the value of `grouping_var`.
You can aggregate `<epichains>` objects returned by the `simulate_*()` functions into a time series, which is a `<data.frame>` with columns "cases" and either "generation" or "time", depending on the value of `by`.

To aggregate over "time", you must have specified a generation time distribution in the simulation step.
```{r include=TRUE,echo=TRUE}
Expand All @@ -322,7 +322,7 @@ sim_tree_eg <- simulate_tree(
lambda = 0.9
)
aggregate(sim_tree_eg, grouping_var = "time")
aggregate(sim_tree_eg, by = "time")
```

### Plotting
Expand All @@ -349,7 +349,7 @@ sim_tree_eg <- simulate_tree(
)
# Aggregate cases over time
sim_aggreg <- aggregate(sim_tree_eg, grouping_var = "time")
sim_aggreg <- aggregate(sim_tree_eg, by = "time")
# Plot cases over time
plot(sim_aggreg, type = "b")
Expand Down

0 comments on commit ab24408

Please sign in to comment.