Skip to contents

Rules for the package development

Documentation

  • Always indicate required params (required)
  • Indicate default values only when (i) a set of values is possible [e.g "bray" for the parameter method in vegan::vegdist()] or (ii) when this value is well thought out and a good default value for most users [e.g. the number of permutation or processors, or the level of identity to cluster at 97%].
  • Indicate the type for logical and integer params.
  • Homogenize the params names across function.
  • Prefer ASVs to OTUs denomination, even thought both are almost interchangeable in the MiscMetabar package.

Lifecycle

  • Experimental: First status for a function
  • Maturing: Some tests and/or analyses make stronger these functions
  • Stable: Good level of confidence

Tests and examples

Special cases of external softwares

Some examples and test required the installation of external softwares. I used MiscMetabar internal functions (such as [is_vsearch_installed()]) to conditionnaly test (if(is_vsearch_installed()){...test...}) and run examples #' @examplesIf is_vsearch_installed().

Special case of CRAN

I use \donttest{} for some long examples (in roxygen documentation) and testthat::skip_on_cran() in long test.

Special case of windows

Some tests and examples are not tested on windows. I used testthat::skip_on_os("windows") inside test and #' @examplesIf tolower(Sys.info()[["sysname"]]) != "windows" in examples (roxygen documentation). Here is a list of functions with some limitations or not working at all on windows OS:

Session information

## R version 4.3.3 (2024-02-29)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Debian GNU/Linux 11 (bullseye)
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.13.so;  LAPACK version 3.9.0
## 
## locale:
##  [1] LC_CTYPE=fr_FR.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=fr_FR.UTF-8        LC_COLLATE=fr_FR.UTF-8    
##  [5] LC_MONETARY=fr_FR.UTF-8    LC_MESSAGES=fr_FR.UTF-8   
##  [7] LC_PAPER=fr_FR.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=fr_FR.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: Europe/Paris
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## loaded via a namespace (and not attached):
##  [1] vctrs_0.6.5       cli_3.6.3         knitr_1.46        rlang_1.1.4      
##  [5] xfun_0.43         purrr_1.0.2       textshaping_0.3.7 jsonlite_1.8.8   
##  [9] htmltools_0.5.8.1 ragg_1.3.1        sass_0.4.9        rmarkdown_2.26   
## [13] evaluate_0.23     jquerylib_0.1.4   fastmap_1.1.1     yaml_2.3.8       
## [17] lifecycle_1.0.4   memoise_2.0.1     compiler_4.3.3    fs_1.6.4         
## [21] htmlwidgets_1.6.4 rstudioapi_0.16.0 systemfonts_1.0.6 digest_0.6.36    
## [25] R6_2.5.1          magrittr_2.0.3    bslib_0.7.0       tools_4.3.3      
## [29] pkgdown_2.0.9     cachem_1.0.8      desc_1.4.3