New versions of R packages

Posted 17 March 2022 by Len Thomas

We are pleased to announce the release of new versions of our R packages Distance, mrds, dsm and dsims. We recommend all users of these packages update to the newest versions.

A full list of changes and updates is given below. Two important changes are:

  1. We are taking steps to improve consistency in function and argument names in our packages, and as part of this for the Distance and mrds packages we have renamed a few functions and argument that used to have a dot in them to having an underscore – so, for example create.bins() is now create_bins(). See below for full list.
  2. We have improved the way that automated and manual selection of detection function adjustment terms in the Distance package, to make them fully congruent with the way Distance for Windows does model selection. In particular, if you use automated selection of Hermite or simple polynomials with half-normal or Hazard rate key function, the lowest polynomial fitted is now order 4 (it was 2 before). For manual selection, the way the order argument works has been changed and a new nadj argument has been added.

These changes affect some of our code example vignettes, available at https://examples.distancesampling.org/ We are updating these, and updates should be finalized by 21st March.

Thanks to those who have made feature requests or reported issues. If you do find any problems, or want to suggest a new feature, please feel free to raise an issue at https://github.com/DistanceDevelopment/distance-bugs/issues or in the github page for each package

https://github.com/DistanceDevelopment/Distance/issues

https://github.com/DistanceDevelopment/mrds/issues

https://github.com/DistanceDevelopment/dsm/issues

https://github.com/DistanceDevelopment/dsims/issues

Full list of changes and updates:

Distance

Changes in version 1.0.5

  • To improve consistency in functions and arguments in the package, some functions and arguments have changed from . separation to _. An error is now thrown when the “old” arguments/functions using . are used. This error will be removed in Distance 1.0.6.
    • create.bins() -> create_bins()
    • `bootdht():
      • convert.units -> convert_units
    • ds():
      • dht.group -> dht_group
      • region.table -> region_table
      • sample.table -> sample_table
      • obs.table -> obs_table
      • convert.units -> convert_units
      • er.var -> er_var
      • debug.level -> debug_level
      • initial.values -> initial_values
      • max.adjustments -> max_adjustments
  • fix bootdht issue when cluster results were requests (#103)
  • improve flatfile documentation (thanks to Maggie Blake for pointing this out)
  • fixed bug in cutpoint calculations in create.bins (#108)
  • order argument to ds() is now only used to specify order, to fix a given number of adjustments use the new argument nadj (see ?ds for more info)
  • fix bug where polynomial adjustments started at the wrong order (2 rather than 4)

mrds

Changes in version 2.2.6

  • Individuals summary table for dht now includes k (number of transects)
  • Add effective detection radius (EDR) and its uncertainty to summary output
  • Change default rounding of chi-squared test tables. This can be customized using print(ddf.gof(...), digits=?) for e.g., printing with knitr::kable
  • New detection function: two-part normal (“tpn”), useful for aerial surveys in mountainous terrain, see Becker EF, Christ AM (2015) A Unimodal Model for Double Observer Distance Sampling Surveys. PLOS ONE 10(8): e0136403. https://doi.org/10.1371/journal.pone.0136403 and ?"two-part-normal".
  • To improve consistency in functions and arguments in the package, some functions will change from . separation to _. For now both versions exist but will be removed in mrds 2.2.7.
    • add_df_covar_line -> add.df.covar.line
    • p_dist_table -> p.dist.table
  • Variable strip widths are now supported in dht. Users should supply an additional column to the sample data.frame (CoveredArea) giving the total area covered in the given transect and set options=list(areas.supplied=TRUE). Thanks to Megan Ferguson for providing an example, code and feedback.

dsm

Changes in version 2.3.2

  • fixed bug in offset calculation in dsm_varprop standard error estimation where offsets were logged twice. Thanks to Megan Ferguson for spotting this.
  • documentation now in RMarkdown format

dsims

New Features in version 0.2.1

  • Now interfaces with new syntax in Distance >= 1.0.5 (it will remain backwards compatible with older versions of Distance for this release)

Bug Fixes in version 0.2.1

  • Plus sampling simulations now issue a warning and modify to minus sampling - these should not have run in previous versions.
  • Fixed default simulation truncation distance to 50 in the analyses (will fix dssd to be consistent with this in release 0.3.2)
  • Fixed the recording of warning / error indexing in parallel simulations