Closed maRce10 closed 1 year ago
Thanks for submitting to rOpenSci, our editors and @ropensci-review-bot will reply soon. Type @ropensci-review-bot help
for help.
Dear @maRce10 ,
Many thanks for your submission and apologies for the delay.
The editorial team was taking a break for the holidays and are now catching up. We'll respond with a decision on whether to accept for review shortly.
Hello again @maRce10 ,
I can confirm we are happy to accept the package for review!
I will shortly assign a handling editor.
In the meantime, I'll run our automated checks. If any issues are flagged, feel free to start addressing them.
@ropensci-review-bot check package
Thanks, about to send the query.
:rocket:
Editor check started
:wave:
git hash: c1b9be0e
Important: All failing checks above must be addressed prior to proceeding
Package License: GPL (>= 2)
The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.
|type |package | ncalls|
|:----------|:------------|------:|
|internal |base | 417|
|internal |warbleR | 41|
|internal |ohun | 25|
|internal |graphics | 11|
|internal |parallel | 7|
|internal |grDevices | 1|
|depends |tuneR | 1|
|imports |sp | 16|
|imports |methods | 10|
|imports |stats | 10|
|imports |utils | 3|
|imports |seewave | 3|
|imports |igraph | 3|
|imports |crayon | 2|
|imports |rlang | 1|
|imports |pbapply | NA|
|imports |viridis | NA|
|imports |fftw | NA|
|imports |knitr | NA|
|imports |Sim.DiffProc | NA|
|suggests |rmarkdown | NA|
|suggests |testthat | NA|
|suggests |formatR | NA|
|suggests |covr | NA|
|linking_to |NA | NA|
Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(
c (33), lapply (27), length (25), sapply (24), unique (22), data.frame (13), rbind (13), is.na (12), unlist (12), do.call (11), if (11), list (11), paste0 (11), sum (11), names (10), drop (9), nrow (9), table (9), for (8), grep (7), strsplit (7), as.data.frame (6), mean (6), which (6), col (5), file (5), ncol (5), round (5), setdiff (5), match.call (4), min (4), seq (4), cos (3), eval (3), getOption (3), paste (3), proc.time (3), sin (3), split (3), any (2), apply (2), as.list (2), by (2), call (2), deparse (2), diff (2), expand.grid (2), matrix (2), scale (2), abs (1), as.numeric (1), cat (1), colMeans (1), colnames (1), complex (1), file.path (1), floor (1), grepl (1), ifelse (1), is.null (1), is.numeric (1), max (1), order (1), pi (1), plot (1), regexpr (1), rep (1), rownames (1), seq.int (1), substring (1), summary (1), t (1), try (1), vector (1), which.min (1)
pblapply_wrblr_int (17), read_sound_file (8), sound_pressure_level (4), info_sound_files (3), duration_sound_ (2), duration_sound_files (2), gaps (2), duration_wavs (1), envelope (1), stft_wrblr_int (1)
FUN (10), diagnose_detection (2), find_templates (2), internal_feature_reference (2), spc_FUN (2), XC_FUN (2), detect_FUN (1), energy_detector (1), feature_acoustic_data (1), label_detection (1), t2xy (1)
over (3), Polygon (3), Polygons (3), Spatia (3), SpatialPoints (3), SpatialPolygons (1)
lines (5), par (4), clip (1), grid (1)
is (10)
poly (4), prcomp (2), smooth (2), na.omit (1), step (1)
makeCluster (4), makePSOCKcluster (3)
as_data_frame (1), graph_from_incidence_matrix (1), max_bipartite_match (1)
env (2), duration (1)
packageVersion (2), head (1)
italic (1), silver (1)
cm (1)
call_args (1)
writeWave (1)
base
warbleR
ohun
sp
graphics
methods
stats
parallel
igraph
seewave
utils
crayon
grDevices
rlang
tuneR
This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.
The package has: - code in R (100% in 21 files) and - 1 authors - 1 vignette - 3 internal data files - 13 imported packages - 18 exported functions (median 65 lines of code) - 39 non-exported functions in R (median 75 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|------:|----------:|:----------| |files_R | 21| 82.3| | |files_vignettes | 1| 68.4| | |files_tests | 17| 95.3| | |loc_R | 2404| 87.4| | |loc_vignettes | 541| 79.9| | |loc_tests | 564| 77.1| | |num_vignettes | 1| 64.8| | |data_size_total | 385966| 90.6| | |data_size_median | 187188| 93.8| | |n_fns_r | 57| 60.6| | |n_fns_r_exported | 18| 64.2| | |n_fns_r_not_exported | 39| 60.5| | |n_fns_per_file_r | 2| 29.4| | |num_params_per_fn | 6| 79.0| | |loc_per_fn_r | 66| 93.6| | |loc_per_fn_r_exp | 66| 85.7| | |loc_per_fn_r_not_exp | 75| 95.2|TRUE | |rel_whitespace_R | 23| 90.3| | |rel_whitespace_vignettes | 45| 88.6| | |rel_whitespace_tests | 39| 86.3| | |doclines_per_fn_exp | 92| 88.7| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 120| 82.1| | ---
Click to see the interactive network visualisation of calls between objects in package
goodpractice
and other checks#### 3a. Continuous Integration Badges [![R-CMD-check](https://github.com/maRce10/ohun/workflows/R-CMD-check/badge.svg)](https://github.com/maRce10/ohun/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 3864222159|pages build and deployment |success |c1b9be | 94|2023-01-07 | | 3864222174|test-coverage |success |c1b9be | 7|2023-01-07 | | 3899091232|tic |success |c1b9be | 49|2023-01-12 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) R CMD check generated the following note: 1. checking installed package size ... NOTE installed size is 5.9Mb sub-directories of 1Mb or more: doc 5.2Mb R CMD check generated the following check_fails: 1. cyclocomp 2. no_description_depends 3. no_import_package_as_a_whole 4. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) ERROR: Test Coverage Failed #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- energy_detector | 52 label_detection | 35 template_correlator | 34 split_acoustic_data | 26 feature_reference | 25 get_envelopes | 21 optimize_energy_detector | 20 summarize_diagnostic | 20 diagnose_detection | 19 label_spectro | 18 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 558 potential issues: message | number of times --- | --- Avoid 1:length(...) expressions, use seq_len. | 2 Avoid 1:ncol(...) expressions, use seq_len. | 3 Avoid 1:nrow(...) expressions, use seq_len. | 34 Avoid library() and require() calls in packages | 3 Avoid using sapply, consider vapply instead, that's type safe | 27 Lines should not be more than 80 characters. | 488 unexpected symbol | 1
:heavy_check_mark: Package contains the following (potentially) obsolete packages: - sp See our [Recommended Scaffolding](https://devguide.ropensci.org/building.html?q=scaffol#recommended-scaffolding) for alternatives.
|package |version | |:--------|:--------| |pkgstats |0.1.3 | |pkgcheck |0.1.0.32 |
Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.
Hi
thanks for reviewing my package. Not sure why you got problems with coverage. It shows 78% coverage in codecov:
https://app.codecov.io/github/maRce10/ohun
as well as in the coverage status badge
https://github.com/maRce10/ohun
So I am not sure how to proceed now.
Cheers
Marcelo
Hello @maRce10
Indeed, that's odd.
Let us look into it and get back to you.
I replaced with seq_len() and vapply() when possible, replace cat() with message() and removed unused dependencies/suggests: 6ea380d
@maRce10 It took a bit of digging, but the test failures are because flac
is not installed. I see you're doing explicit installs in your own GitHub action file. It's common to put these kind of "non-standard" system dependencies in the "SystemRequirements" field of your DESCRIPTION file. Our system would then pick that up and install it, but without that has no way of knowing which libraries your package might need. That said, most systems only match entries given there to the "rules" directory of rstudio/r-system-requirements. Any libraries not listed there, including "flac", are simply ignored. What you should at least do is:
Many of the libraries given in your actions file will automatically pull in several of the others, so you should reduce this set to the minimal possible length, either through checking disribution listings (at least for Debian or Ubuntu), or iterating in a docker container.
Please ping here when your DESCRIPTION has been updated, and let us know what else we might need to install. Thanks.
OK thanks. These non-standard dependencies are not from the ohun package but from a package it relies heavily on, warbleR. These dependencies are now included in the DESCRIPTION file of warbleR on github. Should I also add them to ohun?
No, if they're from another package then they're dependencies of that package not yours. I'll just add flac to our system and ping here when checks can be re-run.
@maRce10 Our system has been rebuilt, and your tests all run successfully now. You may call the bot to run the checks whenever you like.
@ropensci-review-bot assign @jhollist as editor
Assigned! @jhollist is now the editor
@ropensci-review-bot check package
Thanks, about to send the query.
:rocket:
Editor check started
:wave:
git hash: 62cdc87d
(Checks marked with :eyes: may be optionally addressed.)
Package License: GPL (>= 2)
The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.
|type |package | ncalls|
|:----------|:------------|------:|
|internal |base | 448|
|internal |warbleR | 41|
|internal |ohun | 27|
|internal |graphics | 12|
|internal |parallel | 7|
|internal |grDevices | 1|
|depends |tuneR | 1|
|imports |sp | 16|
|imports |stats | 10|
|imports |utils | 3|
|imports |seewave | 3|
|imports |igraph | 3|
|imports |cli | 1|
|imports |methods | 1|
|imports |rlang | 1|
|imports |fftw | NA|
|suggests |knitr | NA|
|suggests |rmarkdown | NA|
|suggests |testthat | NA|
|suggests |viridis | NA|
|suggests |Sim.DiffProc | NA|
|linking_to |NA | NA|
Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(
c (35), lapply (27), length (26), unique (22), vapply (17), sum (14), data.frame (13), rbind (13), unlist (13), is.na (12), do.call (11), if (11), list (11), paste0 (11), names (10), seq_len (10), drop (9), nrow (9), table (9), for (8), mean (8), strsplit (8), grep (7), numeric (7), sapply (7), as.data.frame (6), which (6), col (5), ncol (5), round (5), setdiff (5), any (4), file (4), match.call (4), min (4), seq (4), cos (3), eval (3), getOption (3), logical (3), proc.time (3), sin (3), split (3), apply (2), as.list (2), by (2), call (2), deparse (2), diff (2), expand.grid (2), matrix (2), paste (2), scale (2), abs (1), as.numeric (1), character (1), colMeans (1), colnames (1), complex (1), file.path (1), floor (1), grepl (1), ifelse (1), is.null (1), is.numeric (1), match.arg (1), max (1), order (1), pi (1), plot (1), regexpr (1), rep (1), rownames (1), seq.int (1), substring (1), summary (1), t (1), try (1), vector (1), which.min (1)
pblapply_wrblr_int (17), read_sound_file (8), sound_pressure_level (4), info_sound_files (3), duration_sound_ (2), duration_sound_files (2), gaps (2), duration_wavs (1), envelope (1), stft_wrblr_int (1)
FUN (10), diagnose_detection (2), find_templates (2), internal_feature_reference (2), spc_FUN (2), XC_FUN (2), colortext (1), detect_FUN (1), energy_detector (1), feature_acoustic_data (1), label_detection (1), message2 (1), t2xy (1)
over (3), Polygon (3), Polygons (3), Spatia (3), SpatialPoints (3), SpatialPolygons (1)
lines (5), par (4), clip (1), grid (1), text (1)
poly (4), prcomp (2), smooth (2), na.omit (1), step (1)
makeCluster (4), makePSOCKcluster (3)
as_data_frame (1), graph_from_incidence_matrix (1), max_bipartite_match (1)
env (2), duration (1)
packageVersion (2), head (1)
style_italic (1)
cm (1)
as (1)
call_args (1)
writeWave (1)
base
warbleR
ohun
sp
graphics
stats
parallel
igraph
seewave
utils
cli
grDevices
methods
rlang
tuneR
This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.
The package has: - code in R (100% in 21 files) and - 1 authors - 1 vignette - 3 internal data files - 9 imported packages - 18 exported functions (median 65 lines of code) - 47 non-exported functions in R (median 58 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|------:|----------:|:----------| |files_R | 21| 82.3| | |files_vignettes | 1| 68.4| | |files_tests | 17| 95.3| | |loc_R | 2429| 87.5| | |loc_vignettes | 541| 79.9| | |loc_tests | 571| 77.3| | |num_vignettes | 1| 64.8| | |data_size_total | 385966| 90.6| | |data_size_median | 187188| 93.8| | |n_fns_r | 65| 64.8| | |n_fns_r_exported | 18| 64.2| | |n_fns_r_not_exported | 47| 65.9| | |n_fns_per_file_r | 2| 33.8| | |num_params_per_fn | 6| 79.0| | |loc_per_fn_r | 65| 93.5| | |loc_per_fn_r_exp | 66| 85.7| | |loc_per_fn_r_not_exp | 58| 92.5| | |rel_whitespace_R | 23| 90.5| | |rel_whitespace_vignettes | 45| 88.6| | |rel_whitespace_tests | 39| 86.4| | |doclines_per_fn_exp | 92| 88.7| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 154| 85.5| | ---
Click to see the interactive network visualisation of calls between objects in package
goodpractice
and other checks#### 3a. Continuous Integration Badges [![R-CMD-check](https://github.com/maRce10/ohun/workflows/R-CMD-check/badge.svg)](https://github.com/maRce10/ohun/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 3944417614|pages build and deployment |success |62cdc8 | 103|2023-01-18 | | 3944417809|test-coverage |success |62cdc8 | 16|2023-01-18 | | 3945647101|tic |success |62cdc8 | 64|2023-01-18 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) R CMD check generated the following note: 1. checking installed package size ... NOTE installed size is 5.9Mb sub-directories of 1Mb or more: doc 5.2Mb R CMD check generated the following check_fails: 1. cyclocomp 2. no_description_depends 3. no_import_package_as_a_whole 4. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) Package coverage: 78.11 #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- energy_detector | 52 label_detection | 35 template_correlator | 34 split_acoustic_data | 26 feature_reference | 25 get_envelopes | 21 optimize_energy_detector | 20 summarize_diagnostic | 20 diagnose_detection | 19 label_spectro | 18 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 512 potential issues: message | number of times --- | --- Avoid 1:nrow(...) expressions, use seq_len. | 3 Avoid library() and require() calls in packages | 3 Avoid using sapply, consider vapply instead, that's type safe | 10 Lines should not be more than 80 characters. | 495 unexpected symbol | 1
:heavy_multiplication_x: Package contains the following obsolete packages: - sp See our [Recommended Scaffolding](https://devguide.ropensci.org/building.html?q=scaffol#recommended-scaffolding) for alternatives.
|package |version | |:--------|:--------| |pkgstats |0.1.3 | |pkgcheck |0.1.1.11 |
This package is in top shape and may be passed on to a handling editor
π₯³
@maRce10 just now getting a chance to take a look at this.
One question I have relates to the submission checklist. You did not check the "I have read the author guide and I expect to maintain this package for at least 2 years or to find a replacement." Was curious if that was an oversight or if you expect maintenance of this package to be short term only.
Oh that was an oversight. I am planning to do long term maintenance for this package.
I think we are ready to keep moving on this. Thanks for updating the checklist, @maRce10.
Couple of things I would like to see addressed prior to review are:
sp
with sf
. The sp
package, while not going away entirely, is being replaced by sf
. I took a very quick look at your code and it looks like there are only a few spots where you are using sp
. goodpractice
results in https://github.com/ropensci/software-review/issues/568#issuecomment-1386966949. In particular the lintr
suggestions are some low hanging fruit (don't get too worked up on the over 80 character lines). All of these don't need to be addressed, but considering making these changes is a good idea.bioacoustics
package? How are ohun
and bioacoustics
different/complimentary?As you work on these I will start to identify some possible reviewers. Any questions, just let me know.
Thanks!
I replaced sp
with sf
so sp
is not longer used. I also dealt with most goodpractice
results. After the first check round I fixed all possible instances in which seq_len()
was a better option and replaced sapply()
by vapply()
when possible.
bioacoustics
also has 1 method for doing automatic detection, but has no tools for diagnosing and optimizing those detections. So ohun
could actually be used as a complimentary tool for bioacoustics
. bioacoustics
also does other things that ohun
doesn't, like feature extraction and acoustic file manipulation
@ropensci-review-bot check package
Thanks, about to send the query.
:rocket:
Editor check started
:wave:
π₯³
git hash: 444576a5
Package License: GPL (>= 2)
The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate.
|type |package | ncalls|
|:----------|:------------|------:|
|internal |base | 430|
|internal |warbleR | 41|
|internal |ohun | 25|
|internal |graphics | 7|
|internal |parallel | 7|
|internal |grDevices | 1|
|depends |tuneR | 1|
|imports |methods | 10|
|imports |stats | 7|
|imports |utils | 3|
|imports |seewave | 3|
|imports |sf | 3|
|imports |igraph | 3|
|imports |cli | 1|
|imports |rlang | 1|
|imports |fftw | NA|
|suggests |knitr | NA|
|suggests |rmarkdown | NA|
|suggests |testthat | NA|
|suggests |viridis | NA|
|suggests |Sim.DiffProc | NA|
|linking_to |NA | NA|
Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats(
lapply (27), length (26), c (25), unique (22), vapply (17), data.frame (15), rbind (14), sum (14), unlist (13), do.call (11), if (11), paste0 (11), names (10), nrow (10), seq_len (10), drop (9), is.na (9), table (9), for (8), list (8), mean (8), strsplit (8), grep (7), numeric (7), sapply (7), as.data.frame (6), ncol (5), round (5), setdiff (5), any (4), file (4), match.call (4), min (4), seq (4), which (4), cos (3), eval (3), getOption (3), logical (3), proc.time (3), sin (3), split (3), apply (2), as.list (2), by (2), call (2), deparse (2), diff (2), expand.grid (2), matrix (2), paste (2), pi (2), scale (2), abs (1), as.matrix (1), as.numeric (1), character (1), colMeans (1), colnames (1), complex (1), file.path (1), floor (1), grepl (1), ifelse (1), is.null (1), is.numeric (1), match.arg (1), max (1), order (1), regexpr (1), rep (1), rownames (1), seq.int (1), substring (1), summary (1), t (1), try (1), vector (1), which.min (1)
pblapply_wrblr_int (17), read_sound_file (8), sound_pressure_level (4), info_sound_files (3), duration_sound_ (2), duration_sound_files (2), gaps (2), duration_wavs (1), envelope (1), stft_wrblr_int (1)
FUN (10), diagnose_detection (2), internal_feature_reference (2), spc_FUN (2), XC_FUN (2), detect_FUN (1), energy_detector (1), feature_acoustic_data (1), find_templates (1), label_detection (1), message2 (1), t2xy (1)
is (10)
par (4), clip (1), grid (1), text (1)
makeCluster (4), makePSOCKcluster (3)
prcomp (2), smooth (2), na.omit (1), poly (1), step (1)
as_data_frame (1), graph_from_incidence_matrix (1), max_bipartite_match (1)
env (2), duration (1)
st_as_sf (1), st_intersects (1), st_polygon (1)
packageVersion (2), head (1)
style_italic (1)
cm (1)
call_args (1)
writeWave (1)
base
warbleR
ohun
methods
graphics
parallel
stats
igraph
seewave
sf
utils
cli
grDevices
rlang
tuneR
This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.
The package has: - code in R (100% in 21 files) and - 1 authors - 1 vignette - 3 internal data files - 9 imported packages - 18 exported functions (median 65 lines of code) - 47 non-exported functions in R (median 58 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|------:|----------:|:----------| |files_R | 21| 82.3| | |files_vignettes | 1| 68.4| | |files_tests | 17| 95.3| | |loc_R | 2497| 88.0| | |loc_vignettes | 541| 79.9| | |loc_tests | 571| 77.3| | |num_vignettes | 1| 64.8| | |data_size_total | 385966| 90.6| | |data_size_median | 187188| 93.8| | |n_fns_r | 65| 64.8| | |n_fns_r_exported | 18| 64.2| | |n_fns_r_not_exported | 47| 65.9| | |n_fns_per_file_r | 2| 33.8| | |num_params_per_fn | 6| 79.0| | |loc_per_fn_r | 65| 93.5| | |loc_per_fn_r_exp | 66| 85.7| | |loc_per_fn_r_not_exp | 58| 92.5| | |rel_whitespace_R | 23| 90.4| | |rel_whitespace_vignettes | 45| 88.6| | |rel_whitespace_tests | 39| 86.4| | |doclines_per_fn_exp | 92| 88.7| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 154| 85.5| | ---
Click to see the interactive network visualisation of calls between objects in package
goodpractice
and other checks#### 3a. Continuous Integration Badges [![R-CMD-check](https://github.com/maRce10/ohun/workflows/R-CMD-check/badge.svg)](https://github.com/maRce10/ohun/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 3988367740|pages build and deployment |success |444576 | 104|2023-01-23 | | 3988367842|test-coverage |success |444576 | 17|2023-01-23 | | 3992954250|tic |success |444576 | 71|2023-01-24 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) R CMD check generated the following note: 1. checking installed package size ... NOTE installed size is 5.9Mb sub-directories of 1Mb or more: doc 5.2Mb R CMD check generated the following check_fails: 1. cyclocomp 2. no_description_depends 3. no_import_package_as_a_whole 4. rcmdcheck_reasonable_installed_size #### Test coverage with [covr](https://covr.r-lib.org/) Package coverage: 78.3 #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following functions have cyclocomplexity >= 15: function | cyclocomplexity --- | --- energy_detector | 52 label_detection | 35 template_correlator | 34 split_acoustic_data | 26 feature_reference | 25 get_envelopes | 21 optimize_energy_detector | 20 summarize_diagnostic | 20 diagnose_detection | 19 label_spectro | 18 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 503 potential issues: message | number of times --- | --- Avoid 1:nrow(...) expressions, use seq_len. | 3 Avoid library() and require() calls in packages | 3 Avoid using sapply, consider vapply instead, that's type safe | 10 Lines should not be more than 80 characters. | 486 unexpected symbol | 1
|package |version | |:--------|:--------| |pkgstats |0.1.3 | |pkgcheck |0.1.1.11 |
This package is in top shape and may be passed on to a handling editor
I think this is ready for reviewers! I have a few that I am going to start reaching out to. If you have a few suggested reviewers, I am happy to take a look at those as well.
@ropensci-review-bot seeking reviewers
Please add this badge to the README of your package repository:
[![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/568_status.svg)](https://github.com/ropensci/software-review/issues/568)
Furthermore, if your package does not have a NEWS.md file yet, please create one to capture the changes made during the review process. See https://devguide.ropensci.org/releasing.html#news
OK, I added NEWS.md and the rOpenSci status badge (although doesn't seem to show up properly)
Thanks, @maRce10. I looked over at your README and the badge looks good to me.
I have two requests out for reviewers. Now we wait!
@ropensci-review-bot assign @sammlapp
I'm sorry human, I don't understand that. You can see what commands I support by typing:
@ropensci-review-bot help
@ropensci-review-bot assign @sammlapp as reviewer
@sammlapp added to the reviewers list. Review due date is 2023-02-24. Thanks @sammlapp for accepting to review! Please refer to our reviewer guide.
rOpenSciβs community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.
@sammlapp: If you haven't done so, please fill this form for us to update our reviewers records.
@maRce10 I'm working on my review, but would like to check in on devtools::check('ohun')
. I've never run devtools in R, so forgive me if I'm doing something wrong here. Running devtools::test('ohun')
in R Studio completes without errors, showing all tests passed. However, running devtools::check('ohun')
in R Studio results in an error. I have a MackBook Pro running Mac OS 12.6 with R Studio 2022.07.1 Build 554 and the following version
info
platform aarch64-apple-darwin20
arch aarch64
os darwin20
system aarch64, darwin20
status
major 4
minor 2.1
year 2022
month 06
day 23
svn rev 82513
language R
version.string R version 4.2.1 (2022-06-23)
nickname Funny-Looking Kid
Full traceback of devtools::check('ohun')
:
Documenting ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΉ Updating ohun documentation
βΉ Loading ohun
ββ Building βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Setting env vars:
β’ CFLAGS : -Wall -pedantic -fdiagnostics-color=always
β’ CXXFLAGS : -Wall -pedantic -fdiagnostics-color=always
β’ CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
β’ CXX14FLAGS: -Wall -pedantic -fdiagnostics-color=always
β’ CXX17FLAGS: -Wall -pedantic -fdiagnostics-color=always
β’ CXX20FLAGS: -Wall -pedantic -fdiagnostics-color=always
ββ R CMD build ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β checking for file β/Users/SML161/ohun/DESCRIPTIONβ (351ms)
β preparing βohunβ:
β checking DESCRIPTION meta-information ...
β installing the package to build vignettes
E creating vignettes (16s)
--- re-building βohun.Rmdβ using rmarkdown
Loading required package: tuneR
Loading required package: warbleR
Loading required package: seewave
Loading required package: NatureSounds
Loading required package: knitr
Quitting from lines 326-353 (ohun.Rmd)
Error: processing vignette 'ohun.Rmd' failed with diagnostics:
must install 'Sim.DiffProc' to use this function
--- failed re-building βohun.Rmdβ
SUMMARY: processing the following file failed:
βohun.Rmdβ
Error: Vignette re-building failed.
Execution halted
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, β¦`:
! System command 'R' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Type .Last.error to see the more details.
.Last.error #outputs
Backtrace:
1. devtools::check("ohun")
2. withr::with_envvar(pkgbuild::compiler_flags(FALSE), action = "prefix", β¦
3. base::force(code)
4. pkgbuild::build(pkg$path, tempdir(), args = build_args, quiet = quiet, β¦
5. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$path, β¦
6. base::force(code)
7. pkgbuild::rcmd_build_tools(options$cmd, c(options$path, options$args), β¦
8. pkgbuild::with_build_tools({ β¦
9. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FALSE, β¦
10. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, β¦
11. callr:::run_r(options)
12. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, β¦
13. base::with.default(options, with_envvar(env, do.call(processx::run, β¦
14. base::eval(substitute(expr), data, enclos = parent.frame())
15. base::eval(substitute(expr), data, enclos = parent.frame())
16. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, β¦
17. base::force(code)
18. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdoβ¦
19. (function (command = NULL, args = character(), error_on_status = TRUE, β¦
20. base::throw(new_process_error(res, call = sys.call(), echo = echo, β¦
21. | base::signalCondition(cond)
22. (function (e) β¦
23. asNamespace("callr")$err$throw(e)
Please check off boxes as applicable, and elaborate in comments below. Your review is not limited to these topics, as described in the reviewer guide
The package includes all the following forms of documentation:
vignette()
URL
, BugReports
and Maintainer
(which may be autogenerated via Authors@R
).Estimated hours spent reviewing: 10
I don't typically use R, so some things are not obvious to me. Where can I find the full API documentation? I opened the /docs/index.html to view the docs by rendering the HTML locally, but presumably they are online somewhere. I would recommend linking to the documentation near the top of the README.
The use of the word "reference" to mean "audio annotations" or "labels" is unfamiliar to me, I'm not sure if this word is typically used in the related warbleR package.
The package should give the user some expectation for under what circumstances the detection methods are likely to be effective. Although it mentions that high SNR is required for amplitude thresholding and stereotyped sounds are necessary for template matching, there are other requirements of the data for these approaches to be effective.
In this review, I have not delved into the creation of warbleR selection tables and the interaction of the package with such tables. It seems that this package is aimed towards users who already create and use warbleR selection tables, and because that package is established I consider it "legacy" in the sense that I don't want to review or critique it here. In my experiments with the package, I created a dataframe of "selections" using the split_acoustic_data
function on dry mode (only.sels=TRUE
), renamed columns, and added random values for annotation bounds just to have a fake set of annotations on local audio files to play with.
Overall, functions generally worked as described in the documentation. However, in my experiments the get_templates
function gave an error that I coudn't figure out how to avoid. The primary recommendations of this review are
(1) to improve documentation and function/variable/argument names to better match the action that is actually taken by a function;
(2) to consider a moderate refactor of code to increase modularity, reduce redundancy, and aim to follow the Single Responsibility Principle;
(3) increase code readability by breaking complex logical lines into separate lines with additional comments, plus comments describing the general purpose of large blocks of code.
devtools::test('ohun')
runs without error, but as posted above devtools::check('ohun')
raises an error for me.
Template-based cross correlation is implemented in monitoR, while energy-based detection is implemented in bioacoustics (the implementation seems more generic and featured than the one in ohun).
I wonder if the proposed value of Ohun is mostly in its specific ability to interact with the formats of annotations produced by warbleR. If so, the top-level documentation and README could clarify this purpose.
Specifically, when I started using the program without having any experience with warbleR, it was not clear to me how to create annotation tables or generally what the utility of most of the package functions are. Writing a description of the characteristics of data that this package expects as input would be helpful. For instance, "This package provides utilities for comparing detection and annotations of audio events described by frequency and time boxes. Creating annotations containing such frequency-time boxes [is possible in the warbleR package?]."
The package is very 'flat' in the sense that functions rarely call other functions, but instead take a bunch of arguments to do a bunch of things in one go. One result of this is that many functions take a long list of parameters, and parameters are redundant across many functions. For example, several functions take the same set of spectrogram parameters. To me, this raises the concern of accidental inconsistency in a user's script (eg, by passing different spectrogram parameters to two different functions).
In the language of rOpenSci software recommendations, this is a sign that the functions are not "modular". In other places it might be seen as a violation of the Single Responsibility Principle (SRP). For example, the label_specto
function violates SRP because it doesn't just label a spectrogram: it computes a spectrogram, plots it, then overlays labels, and might additionally comput and plot an amplitude signal. As another example, I get_envelopes.R and energy_detector.R seem to both implement the process of getting an amplitude envelope, rather than using shared modular functionality specific to this purpose.
Though it would take a significant refactoring effort, I believe creating a more modular code base that aims to achieve the SRP could improve the package and user experience overall.
In general, the code is difficult to read because of the formatting and smushing lots of logic into a single functional "line" (which is broken into many lines anyways due to formatting). Separating out logical steps into sequential lines, with comments where appropriate, would make the code easier to read/understand/maintain. However, it would take a major refactoring effort.
Consider adding units to variable names eg hold_time_ms
A few specific comments on two source files provide examples of what I see as possible areas for improvement:
summarize_diagnostic.R
: summ_diagnostic$mean.duration.true.positives <-
if (any(!is.na(Y$mean.duration.true.positives)))
round(
stats::weighted.mean(
x = Y$mean.duration.true.positives,
w = Y$true.positives,
na.rm = TRUE
),
0
) else
NA
In general I'm not reading this code base to check for logical errors, but I think that the code style will make it difficult for others (or the authors) to debug, extend, understand or modify the code. In this example, separating the logical operation into a few separate and sequential lines of code could make it easier to digest, and would provide opportunities to add comments for any individual steps whose purposes are not obvious. (For example in this code, a comment could explain why we would want a weighted mean of true positive durations.)
Input validation is redundant across many functions, eg validating the cores
argument. Rather than repeating code in several modules, use modular helper functions. That way, if you change something it is consistent across the codebase.
Comments should explain not just what's being done but also why (rather than re-stating the code in English). For example, instead of # set bottom and top freq if not supplied
you could explain the bottom and top frequency are needed to make a spectrogram. if they're not supplied, we set them to 0 and Ns=sample_rate/2
. Another example, in template_detector.R
L177 "# if no detections" is not a helpful comment - the comment should explain what will happen and why.
Since I'm not an R programmer, I might not understand conventions for writing R modules. However, I don't think it's a good idea to define your helper functions inside another function. For example L218 of template_correlator.R begins a definition of a function to create a spectrogram. Even if this is not part of the API (its a hidden or internal function), I think it should be defined outside of the template_correlator function (1) because it doesn't make sense that it would be re-defined each time template_correlator is called, and (2) because it makes reading the code for template_correlator unnecessarily long.
I'm not sure how namespaces work in R but it would be helpful for a code reader to know where functions are coming from. For instance, get_templates.R
calls find_templates
which is not explicitly imported or defined anywhere in the file. It apparently can be accessed because it exists in another .R file in the package, or because all functions from the package have been imported into the default namespace.
The "main features" description is jargon-y and could be written in broader language. For example, "The use of signal detection theory indices to evaluate detection performance" -> "Evaluate detection accuracy with precision, recall, and other metrics". As is, I feel like it obscures the functionality of the package. As another example, I wasn't sure what "Optimize detection routines based on reference annotations" meant - after reading further, I think it basically means "Adjust detection parameters to optimize accuracy on a labeled set of recordings"
"Template-based detection" It's not true that template-based detection "doesnβt depend on the signal-to-noise ratio" - high background noise or low signal level will decrease the accuracy of this approach
outputs (eg, tables) in the Getting Started tutorial are very hard to interpret in the current form, could they be rendered as human-readable tables?
"Detections from other software can also be explored and optimized." I don't see how detections from another platform could be "optimized" in ohun unless you just mean changing a score threshold and measuring the resulting precision and recall.
An example of how to analyze a large set of files, for instance all files in a folder-subfolder structure, would be helpful. I had to do some googling to figure out how to do "globbing" ie find all paths mathing a pattern.
Throughout the codebase, I recommend more informative variable and argument names: for example, in the function merge_overlaps
, to a new user, pb is not interpreted as "progress bar"
Throughout the documentation: why are arguments that are numbers/strings called "numeric vectors of length 1" and "character vectors of length 1"? This makes me thing I should pass c(0) or [0] instead of 0, for instance, as an argument.
get_envelopes
:
energy_detector
: again, I don't think making files optional and defaulting to all audio in the working directory is a good idea.
label_spectro
: can you provide an example of how to use this function with an audio file? If I want to run it on anything other than a simulated array of numbers or the two built-in audio files, I need some prior line of code to load the audio file, for example:
library(tuneR)
w <- readWave("~/sample_audio/birds_10s.wav")
bp
argument (in several functions): how is the signal bandpassed? Should state specifically, for example, a 9th order Butterworth bandpass filter
feature_reference
: "Extract quantitative features of references" - from the function name and short description, I expected this to extract acoustic features of the annotated audio events themselves, rather than summary statistics of the annotations per se. Perhaps the description could be "Summarize temporal and frequency dimensions of annotations and gaps" or something similar. Ideally, the function's name would reflect its functionality, something like summarize_annotation_boxes
.
energy_detector
, but the min, max, and mean are not very informative, because what matters is the typical gap time between close-together annotations. Maybe the median or 25th percentile, or some other statistic, would be more informative. Similarly, feature_acoustic_data
sounds like it would measure some acoustic feature. Since the function returns information about the file types, I would call it something like summarize_audio_file_characteristics
filter_detection
I'm confused as to what this function is doing. The documentation says it "removes ambiguous detections (split and merged detections)", but the detailed documentation should explain what is meant by split and merged detections. I'm also confused whether this is meant to be applied to human-created annotations, automatically-generated detections, or can be used for either purpose.
optimize_template_detector
: this function compares performance across parameter values, it does not itself optimize the algorithm, so its name is a bit misleading. Perhaps template_parameter_sweep
is closer. I'm not sure what paramter values it sweeps over after reading the documentation, since it requires the user to have already run template_correlator
. Also, I think the part of the documentation that says "Those parameters can be later used for performing a more efficient detection using optimize_template_detector." must be a typo, perhaps it means "using template_correlator
" instead?
label_spectro()
: this is a plotting function, so it would be better named something like plot_spec_and_labels
get_templates
: can you explain what features are being used to create this principle component analysis of template similarity? Also, after understanding what this function does, it seems like it would be better named something like select_representative_templates
or select_representative_annotations
since it chooses representative templates from a set of annotations.
split_acoustic_data
: it should be possible, if not required, to list the audio files to split. It seems like I must split every file within a folder in the current implementation.
label_detection
function name does not match what it does. It seems this function evaluates detections against a set of annotations/labels/"references" so perhaps it should be called evaluate_detections
or compare_annotations_and_detections
template_correlator
it's unclear to me how to use the files argument. I don't know what 'X' is as referred to in the documentation, and I would expect to simply be able to pass a vector of file paths.
full_spectrograms
: it was surprising to me that this function automatically saved image files to the current working directory, rather than asking for a save dir or displaying them in the console. This doesn't seem like a good practice, because I might not want to save the results and if I do, I'd like to choose where they go.
Other note: I would be very surprised if template matching is faster than amplitude-based detection, as claimed in the "Improving detection speed" section. Amplitude-based detection is about the lightest task you can perform on a time signal while 2d cross correlation is relatively heavy.
When I try to run get_templates on my own file set, I get this error:
Error in prcomp.default(spectral_parameters[, 2:27], scale. = TRUE) :
cannot rescale a constant/zero column to unit variance
I tried to run get_templates on a set of local files, but it seems somehow one of the features has no variance and this is causing the PCA to fail. I wasn't able to resolve this.
Running template_correlator then template_detector on the results produced a table containing NA values for many rows in the start, end, and scores columns. I did not expect this, and it caused errors when I tried to run other analyses on these detections.
Once I ran template_correlator and template_detector, I wasn't sure how to inspect my detections although it seemed like I should be able to use full_spectrograms or some other package function.
When I first ran label_spectro, I got the message "Error in loadNamespace(x) : there is no package called βviridisβ". I'm not sure if this suggests a missing dependency. I resolved the issue by running install.packages("viridis")
When I run label_spectro
with env = TRUE, I get an error message:
w <- readWave("~/sample_audio/birds_10s.wav")
label_spectro(wave = w@left,
f=w@samp.rate,
env = TRUE)
Error in label_spectro(wave = w@left, f = w@samp.rate, env = TRUE, fastdisp = TRUE) :
trying to get slot "samp.rate" from an object of a basic class ("integer") with no slots
Add a more helpful error message for accidental use of Hz instead of kHz: If my detection table has Hz instead of kHz and I run get_templates, the error message says "Caution! This is a null spectrum. The spectral entropy is null!"
Thanks for the review. Is there a specific format to respond to these concerns?
@maRce10 Typically it is best to provide an itemized response in this issue for each of the comments in the review. Also make sure you address any of the relevant, unchecked items in the checklist at the top of the review. For some more detailed info please see https://devguide.ropensci.org/authors-guide.html#the-review-process for some more informatoin.
Also, I am still working on finding a second reviewer. You can either wait until the 2nd review is complete or you can make updates now and then the 2nd reviewer can address the updated version. In either case I will keep forging ahead with trying to find reviewers.
:calendar: @sammlapp you have 2 days left before the due date for your review (2023-02-24).
@maRce10 Just wanted to update you. I am still looking for a second reviewer. I have a few more on my list to try. If you have anymore questions or concerns, please let me know.
@maRce10 And the search for a 2nd reviewer continues... Was curious if you had worked on the edits that @sammlapp suggested in his review or if you were waiting until both reviews are in? Sorry for the delay in moving this along!
@ropensci-review-bot assign @robitalec as reviewer
@robitalec added to the reviewers list. Review due date is 2023-05-11. Thanks @robitalec for accepting to review! Please refer to our reviewer guide.
rOpenSciβs community is our best asset. We aim for reviews to be open, non-adversarial, and focused on improving software quality. Be respectful and kind! See our reviewers guide and code of conduct for more.
@robitalec: If you haven't done so, please fill this form for us to update our reviewers records.
Date accepted: 2023-09-13
Submitting Author Name: Marcelo Araya-Salas Submitting Author Github Handle: !--author1-->@maRce10<!--end-author1-- Repository: https://github.com/maRce10/ohun Version submitted: 0.1.0 Submission type: Standard Editor: !--editor-->@jhollist<!--end-editor-- Reviewers: @sammlapp, @robitalec
Archive: TBD Version accepted: TBD Language: en
Scope
Please indicate which category or categories from our package fit policies this package falls under: (Please check an appropriate box below. If you are unsure, we suggest you make a pre-submission inquiry.):
Explain how and why the package falls under these categories (briefly, 1-2 sentences):
The packages allows to get data from animal acoustic signal recordings in an automated manner
Who is the target audience and what are scientific applications of this package? Scientific community working with bioacoustic data. Useful to automate analysis of animal acoustic signals for a variety of research questions (e.g. behavior, ecology, evolution, conservation)
Are there other R packages that accomplish the same thing? If so, how does yours differ or meet our criteria for best-in-category?
the warbleR package has similar functions for detecting but the implementation is not as friendly (I am also the maintainer) and has no tools for detection diagnose/optimization. monitoR also implements one of the detection approaches in ohun but no diagnosing/optimization tools are supplied.
(If applicable) Does your package comply with our guidance around Ethics, Data Privacy and Human Subjects Research?
If you made a pre-submission inquiry, please paste the link to the corresponding issue, forum post, or other discussion, or @tag the editor you contacted.
Explain reasons for any
pkgcheck
items which your package is unable to pass.Technical checks
Confirm each of the following by checking the box.
This package:
Publication options
[x] Do you intend for this package to go on CRAN?
[ ] Do you intend for this package to go on Bioconductor?
[x] Do you wish to submit an Applications Article about your package to Methods in Ecology and Evolution? If so:
MEE Options
- [x] The package is novel and will be of interest to the broad readership of the journal. - [x] The manuscript describing the package is no longer than 3000 words. - [x] You intend to archive the code for the package in a long-term repository which meets the requirements of the journal (see [MEE's Policy on Publishing Code](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/journal-resources/policy-on-publishing-code.html)) - (*Scope: Do consider MEE's [Aims and Scope](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/aims-and-scope/read-full-aims-and-scope.html) for your manuscript. We make no guarantee that your manuscript will be within MEE scope.*) - (*Although not required, we strongly recommend having a full manuscript prepared when you submit here.*) - (*Please do not submit your package separately to Methods in Ecology and Evolution*)Code of conduct