filament_compression: Compress filaments to filaments with the same number of...

Description Usage Arguments Value Examples

View source: R/containment-and-band-creation.R

Description

Compress filaments to filaments with the same number of points (equally linearly space compared to original filament definition)

Usage

1
filament_compression(grouped_df, data_columns = NULL, number_points = 13)

Arguments

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 c(S,I,R) or c("S", "I", "R"). If the input is NULL this function will treat this like all non-group columns.

number_points

integer number of points for each filament to be compressed to

Value

updated grouped_df with new rows so that each filament has the same number of points.

Examples

 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)

skgallagher/EpiCompare documentation built on Sept. 14, 2021, 5:45 a.m.