Changelog
Source:NEWS.md
rbms 1.3.1
New features
-
flight_curve()gainsparallelandn_coresto fit the flight curves of the years in parallel. The random streams of the workers are seeded from the session, so the result is reproducible withset.seed().
Changes
-
flight_curve_optimised()andget_nm_optimised()are deprecated: they gave the same results asflight_curve()andget_nm(), which they now call with a warning. -
flight_curve_multi(),fit_bam_multi()andplot_flight_curve_multi()(onebam()model for all years) are removed from the package for further development; they return an error, the previous code is available in rbms 1.3.0. -
flight_curve()checks all the required columns ofts_season_count(only the first one was checked). -
flight_curve()withKeepModel = FALSEandKeepModelData = TRUEreturns the flight curves and the data (it returned the unformatted list).
Documentation
- Vignette: the installation code is shown but not run, the messages of
flight_curve()are not printed,linewidthreplaces the deprecatedsizeof ggplot2 lines; author and date updated. - LICENSE year 2022-2026.
Potential breaking changes
- Code using
flight_curve_multi(),fit_bam_multi()orplot_flight_curve_multi()(exported in 1.3.0) needs rbms 1.3.0, orflight_curve(). -
flight_curve()now stops with a clear message when a required column ofts_season_countis missing.
rbms 1.3.0
New features
-
collated_index()gainsGlmFit = c("glm", "newton", "ipf"). With"newton"or"ipf", the same weighted Poisson GLM (site and year effects) is fitted without building the model matrix and gives the same collated index asglm(), much faster with many sites (e.g. 0.2 s instead of 3 minutes with 2000 sites and 20 years). With"newton", the year effects and their standard error are returned (year_effect). -
collated_index()gainssite_length(index per 1 km of transect) andindex_sites = c("all", "observed")(index averaged over all monitored sites or over the sites where the species was observed). - New
collated_index_mixed(): the collated index from a mixed model with a random site effect (package glmmTMB, Poisson or negative binomial), with an optional habitat (stratum) effect and habitat weights (by sites, equal or user defined, e.g. area),site_lengthas offset andindex_sites. It links years that are not linked through common sites, for randomised designs such as rotating panels. -
boot_sample()gainss_spto draw the bootstrap samples per species, stratified by the occurrence of zeros at the sites and by group of linked years, withhabitatas additional stratum. A sample with fewer thanmin_yearyears or where a group of linked years is split or lost is drawn again, up tomax_trialtimes; failed samples are returned as NA rows. Withouts_sp, the samples are drawn as before. -
impute_count()gainsSindexMethod = c("ratio", "glm"). The default ratio is unchanged; with"glm", the counts of the time steps not visited are predicted from a Poisson GLM with site and year effects and the flight curve as offset (GlmFit = c("newton", "ipf")), which avoids extreme site indices at low coverage. The year effects are returned as attributeglm_year_effect.
Changes
-
collated_index(): when the years form groups not linked through sites with observations, each group is fitted separately (SplitGroup = TRUE, default) and identified in the new columnGROUP; fitting all years together gave arbitrary levels between groups.SplitGroup = FALSEreproduces the previous fit. - Site-years with NA or infinite site index are treated as missing:
impute_count()returns NA instead ofInforNaNwhen the visits cover no part of the flight curve (TOTAL_NM = 0), andsite_index(),collated_index(),collated_index_mixed()andboot_sample()remove them (previously a site with NA in all years set the collated index to 0 in all years). - A bootstrap sample that failed in
boot_sample()returns NA incollated_index();boot_inddrawn for another species is an error. -
collated_index_old()is deprecated and returns an error, usecollated_index(). -
plot()andpoints()methods forpheno_curveobjects: the first argument is nowx, as in the generics. - speedglm is no longer needed; glmmTMB and ggplot2 are suggested.
Potential breaking changes
With the default arguments, the results of the standard workflow (flight curve, imputed counts, site indices, collated index and bootstrap) are identical to version 1.2.1. A pipeline is only affected in the following, unlikely cases:
-
collated_index()returns an additional columnGROUPincol_indexand an additional elementyear_effect; code that selects columns by position or binds outputs withrbind()may need adjusting (selection by name anddata.table::rbindlist()are not affected). - Data where the years form groups not linked through common sites: the collated index now differs, each group being fitted separately (
SplitGroup = FALSEgives the previous result, whose levels between groups were arbitrary). - Data with NA or infinite site indices: these site-years are now removed; previously an NA site set the collated index to 0 in all years, and
site_index(MinFC = NULL)kept infinite values. - speedglm is no longer installed with rbms; scripts calling
speedglm()directly need it installed. -
collated_index_old()now returns an error (it did not run in previous versions).