grab_top_depth_filaments: Select a proportion of the top / most deep filaments

Description Usage Arguments Value Examples

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

Description

similar to depth_curves_to_points.grouped_df

Usage

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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)

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