Description Usage Arguments Value Examples
View source: R/containment-and-band-creation.R
Compress filaments to filaments with the same number of points (equally linearly space compared to original filament definition)
1 | filament_compression(grouped_df, data_columns = NULL, number_points = 13)
|
grouped_df |
grouped_df data.frame object (assumed rows per filament are ordered) - grouped per each filament |
data_columns |
columns of data.frame that relate to
the filament's coordinates in euclidean space. The input should look like
something like |
number_points |
integer number of points for each filament to be compressed to |
updated grouped_df with new rows so that each filament has the same number of points.
1 2 3 4 5 6 7 8 9 10 11 12 | library(dplyr)
t13compression <- EpiCompare::pomp_sir %>%
arrange(time) %>% # just to be safe
select(-H, -cases, -time) %>%
filter(.id <= 5) %>%
group_by(.id) %>%
filament_compression()
t9compression <- EpiCompare::pomp_sir %>%
filter(.id <= 5) %>%
group_by(.id) %>%
filament_compression(data_columns = c("S","I","R"), number_points = 9)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.