R/distance-depth.R
quantile_curves_to_points.Rd
pulling out data points from curves that are ranked highest based on quantile function.
quantile_curves_to_points( x, alpha, dist_mat, dist_func = distance_depth_function, ... ) # S3 method for list quantile_curves_to_points( x, alpha, dist_mat, dist_func = distance_depth_function, ... ) # S3 method for grouped_df quantile_curves_to_points( x, alpha, dist_mat, dist_func = distance_depth_function, ... )
x | list or grouped_df containing curves, with index ordering associated with the dist_mat's row ordering |
---|---|
alpha | the proportion of curves to be removed before presenting all the points together. Takes value in [0, 1.0]. |
dist_mat | distance matrix |
dist_func | function to calculate quantiles via the distance_matrix |
... | additional parameters to be passed to the dist_func |
data frame from curves of the top values associated with the
dist_func
This function for lists (renamed as depth_curves_to_points
)
is shared with TCpredictionbands on github:
TCpredictionbands.
library(dplyr) set.seed(1) random_data_list <- lapply(1:5, function(x){data.frame(matrix(rnorm(10), ncol = 2))}) dist_mat <- dist_matrix_innersq_direction(random_data_list, position = 1:2, verbose = FALSE) combined_points_list <- quantile_curves_to_points(random_data_list, alpha = .2, dist_mat) random_data_grouped <- random_data_list %>% do.call(rbind, .) %>% mutate(id = rep(1:5, each = 5)) %>% group_by(id) combined_points_grouped <- quantile_curves_to_points(random_data_grouped, alpha = .2, dist_mat)