Description Usage Arguments Value Examples
View source: R/containment-and-band-creation.R
similar to depth_curves_to_points.grouped_df
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
)
|
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 |
filament_depth_function |
function to calculate depth relative to the
filaments in the |
conf_level |
proportion of filaments to keep |
.remove_group |
boolean (default true). Should the output keep the grouping columns or just havd data points? |
updated grouped_df
with only the top depth filaments
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.