similar to depth_curves_to_points.grouped_df

grab_top_depth_filaments(
  grouped_df,
  data_columns = NULL,
  filament_depth_function = filament_distance_depth,
  conf_level = 0.95,
  .remove_group = TRUE
)

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.

filament_depth_function

function to calculate depth relative to the filaments in the grouped_df. Will take in data_columns parameter as well

conf_level

proportion of filaments to keep

.remove_group

boolean (default true). Should the output keep the grouping columns or just havd data points?

Value

updated grouped_df with only the top depth filaments

Examples

library(dplyr) top_filaments <- EpiCompare::pomp_df %>% group_by(.id) %>% filter(.id <= 10) %>% grab_top_depth_filaments(data_columns =c("S","I","R"), conf_level = .5) # note that the below doesn't contain all filaments - as some have 0 depth all_but_extreme_filaments <- EpiCompare::pomp_df %>% group_by(.id) %>% filter(.id <= 10) %>% grab_top_depth_filaments(data_columns = c("S","I","R"), conf_level = 1)