R/containment-and-band-creation.R
filament_compression.Rd
Compress filaments to filaments with the same number of points (equally linearly space compared to original filament definition)
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.
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)