Last active
December 4, 2021 16:15
-
-
Save markushuff/b8af1d3931050cfc2c628e2199a3d10b to your computer and use it in GitHub Desktop.
Get a list including the n highest event boundaries of a segmag object (Papenmeier, 2016; https://cran.r-project.org/package=segmag). Sometimes it is necessary to get just a list of the n highest event boundaries w/o doing the time consuming bootstrapping method. Note, this function requires the segmag package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_n_eb_times <- function(n, segmag) | |
{ | |
eb_times <- get_eb_times(segmag, | |
cutoff = mean(segmag$data$segmentation_magnitude)) | |
out <- segmag$data[segmag$data$time %in% eb_times, ] | |
out <- out[order(out$segmentation_magnitude, decreasing = TRUE),] | |
out[1:n,] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment