R Under development (unstable) (2023-11-08 r85496 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > ## > ## f i n d p e a k s . R Test suite > ## > > > findpeaks <- pracma::findpeaks > > x <- c(2, 12, 4, 6, 9, 4, 3, 1, 19, 7) > identical(findpeaks(x), + matrix(c(12,9,19, 2,5,9, 1,3,8, 3,8,10), nrow=3, ncol=4)) [1] TRUE > identical(findpeaks(x, npeaks = 1, sortstr = TRUE), + matrix(c(19, 9, 8, 10), nrow = 1)) [1] TRUE > identical(findpeaks(x, minpeakheight = 15), + matrix(c(19, 9, 8, 10), nrow = 1)) [1] TRUE > identical(findpeaks(x, threshold = 10), + matrix(c(19, 9, 8, 10), nrow = 1)) [1] TRUE > # Not yet implemented > # identical(findpeaks(x, threshold = 10), > # c(19, 9, 8, 9)) > > > proc.time() user system elapsed 0.15 0.07 0.17