Changelog
Source:NEWS.md
cati 0.99.7
CRAN release: 2026-11-10
This release fixes the bugs found in an external audit of cati 0.99.6 (GH-11 to GH-21). Many of them change numerical results. The section below says which analyses are affected and by how much; the figures come from finch.ind (6 plots, 4 traits, 199 permutations), comparing 0.99.6 and 0.99.7. Between two seeds of 0.99.7, the SES of Tstats() vary by 0.5 (median), so smaller differences are noise.
Which results change
Results that do not change:
- Observed values of
Tstats(), when no plot name is contained in another one and the levels ofind.plotare in alphabetical order. -
ComIndex()with thelocalandregional.indnull models, when the rows are sorted by plot,reg.poolis not a list,SE = 0,independantTraits = TRUEand the index does not compute nearest-neighbour distances on tied values. Onfinch.ind, observed values, null values and SES are identical. - Null values of
T_IC.IRandT_PC.PRinTstats()whenreg.poolis not a list, the rows are sorted by plot and the traits have noNA: the differences are within noise. - P-values of
sum_Tstats(), except when the observed value equals null values or isNA, or when some null values areNA.
Results that change:
-
Tstats(), null values ofT_IP.IC, in every analysis (GH-12). Onfinch.ind, the SES change by 15% in median (up to 77%) and keep their sign, and all 23 significant cells stay significant. The change is larger when the rows are not sorted by plot. -
Tstats(), null values ofT_PC.PRwhen the traits containNA(GH-19): populations with at least oneNAvalue were left out of the regional pool. Onfinch.ind(1137NAvalues), 7 of the 24 cells become significant (SES 2 to 3.6), against none before. -
Tstats(), null values ofT_IC.IRwhenreg.poolis a list (GH-18): each community was compared with a mix of all the regional pools. -
Tstats(), observedT_IP.ICwhen a plot name is contained in another one (1and10,p1andp10) or contains regex characters (GH-11): the populations of several plots were pooled (0.44 instead of 0.006 in the GH-11 example). -
Tstats(), rows ofT_IP.ICandT_IC.IRwhen the levels ofind.plotare not in alphabetical order, for example a numeric plot code (GH-17): values were labelled with the name of another plot, so any comparison with plot covariates used the wrong plots, andsum_Tstats()andbarplot.Tstats()combined statistics of different plots. -
ComIndex()andComIndexMulti()with theregional.popnull model and more than one trait (GH-14): the null values were drawn from all traits pooled. Onfinch.ind, the significance changes in 23 of 24 cells for the mean and 19 of 24 for the variance. -
ComIndexMulti()with more than one trait, with any null model (GH-13): the null values mixed the traits. Onfinch.ind, thelocalnull values of the mean of the first trait ranged from 9.6 to 70.7 instead of 67.0 to 68.3. -
ComIndex()andComIndexMulti()when the rows are not sorted by plot (GH-15): indices usingsporby.factor, and the observed values ofregional.pop, were computed on misaligned species. -
MNND(),MinNND(),SDNND()andMinMaxMST()when trait values are tied (GH-21): zero distances were dropped. Tied values are the rule infinch.ind(92% to 98% of the values), and the significance ofMNNDunderregional.indchanges in 13 of 24 cells. -
ComIndex()andComIndexMulti()null values whenreg.poolis a list,SEis not 0 with thelocalnull model, orindependantTraits = FALSE(GH-21). -
ses(),ses.Tstats(),plot.Tstats()andPval()when the number of plots equals the number of traits, or, forComIndex(), when the number of permutations equals one of them (GH-20): rows and columns were swapped. For aComIndex()index that returns one value per trait, such as"mean(x)", the layout is still guessed from sizes. -
Pval():pval.infandpval.supare swapped, and the traits after the first one were missing (GH-19, GH-20). -
sum_Tstats(): the site list ofT_IC.IR.infand the binary row ofT_PC.PR.supshowed another statistic (GH-16).
Breaking changes
-
Pval():pval.infandpval.supare swapped to matchsum_Tstats(), sopval.infis now small when the observed value is lower than the null values. Scripts that readpval.inforpval.supsilently get the other tail; swap the two names to keep the previous meaning (GH-19). -
Pval()now returns one element per trait instead of only the first trait (GH-20). -
Tstats(): rows ofT_IP.IC,T_IC.IRandT_PC.PRfollowlevels(ind.plot), the order already used byreg.poollists, instead of the alphabetical order. When the levels ofind.plotare not alphabetical, the rows ofT_PC.PRmove; index rows by name rather than by position (GH-17). -
MNND(),MinNND(),SDNND()andMinMaxMST()keep the zero distances between individuals with the same trait values, and only exclude the distance of an individual to itself, asCVNND()already did. They used to drop every zero distance, which ignored tied values. With traits measured at a coarse resolution,MinNND()andMinMaxMST()are now often 0 (GH-21).
Bug fixes
-
barplot.decompCTRE()works withresume = FALSE(GH-21). -
ComIndex()andComIndexMulti()keep species,by.factorand traits aligned when the rows are not sorted by plot (GH-15). -
ComIndex()andComIndexMulti()draw each trait from its own values in theregional.popnull model (GH-14). -
ComIndex()andComIndexMulti()use the regional pool of each community whenreg.poolis a list, applySEin thelocalnull model, acceptSE.reg.poolas a list, report the number of species in$sites_richness, sample correctly in plots with a single individual, and give different draws to plots of equal size whenindependantTraits = FALSE(GH-21). -
ComIndex()andComIndexMulti()work with a single trait. -
ComIndex()withnullmodels = "regional.pop"or"regional.pop.prab"evaluatesindexon one value per population withind.plotandspgiving the plot and species of each population, so indices such as"tapply(x, ind.plot, mean)"work with every null model. TheComIndex()example no longer needs a workspace variable. -
ComIndexMulti()builds the null values of each trait from that trait only (GH-13). -
ComIndexMulti()withnullmodels = "regional.pop.prab"no longer errors, and groups population-level values withby.factor. -
CVNND()no longer returnsNAwhenna.rm = FALSE(GH-21). -
decompCTRE()excludes individuals withNAtraits from the weights (GH-21). -
plotDistri()draws populations of a single individual at their value and builds its legend with any number of levels (GH-21). -
plotRandtest()reads the null values ofTstatsobjects and ofComIndexindices that return one value per community in the right layout, and its per-trait plot now tests the mean of the index over communities (GH-21). It still fails onComIndexMultiobjects and onComIndexindices that return one value per trait. -
plotSESvar()works with one or two traits and no longer changes the global palette (GH-21). -
plotSpPop()andplotSpVar()keep species and traits aligned when the rows are not sorted by plot (GH-15), match populations without splitting names on_, and no longer fail oncolor.lmwith the defaultmin.ind.signif(GH-21). -
Pval()andsum_Tstats(type = "p.value")count ties with the null values against significance, dropNAnull values from the denominator, and returnNAwhen the observed value or all null values areNA(GH-19). -
RandCom()gives distinct names to species beyond the 26th (GH-21). -
RaoRel()returnsFD$Beta_addandFD$Beta_propwithJost = TRUE(GH-21). -
samplingSubsetData()samples correctly from units of one individual withtype = "count", keeps the largest units first withtype = "factorBySize", and respectsMinSamplewithtype = "propBySize"(GH-21). -
ses()gains anull.dimsargument to give the layout of a bare null array.ses(),ses.listofindex()andPval()use the layout ofTstatsandComIndexnull values instead of guessing it from sizes, which gave wrong values when the numbers of plots, traits or permutations were equal (GH-20). The layout is still guessed forComIndexindices that return one value per trait. -
sum_Tstats(): theT_IC.IR.infrow oftype = "site"and theT_PC.PR.suprow oftype = "binary"(and oftype = "all") report their own statistic (GH-16). -
Tstats()matches the populations of a plot by exact name, so plotp1no longer pools the populations ofp10and plot names may contain regex characters (GH-11). -
Tstats()null models 1, 2 and 2sp keep each permutation and plot together, so null values no longer mix individuals of other plots or other permutations (GH-12, GH-18). -
Tstats()accepts a characterind.plot, unused levels, and@in species or plot names, and gives different draws to plots of equal size whenindependantTraits = FALSE(GH-21). -
Tstats()computes the population means of null model 2sp withna.rm = TRUE, and storesNAinstead of the string"NA"for plots with a single individual (GH-12, GH-19).
cati 0.99.5
-
MinMaxMST()andSumBL()now usecluster::daisy()instead ofFD::gowdis()for Gower distance computation, replacing the FD dependency which is scheduled for CRAN archival. -
plot.ComIndexMulti(),plot.listofindex(),Pval(),print.ComIndex(),print.ComIndexMulti(),print.Tstats(),ses(), andses.listofindex()no longer error on R >= 4.0 whereclass()on a matrix returns two values ("matrix" "array"), and on R >= 4.5 where such comparisons inifconditions are treated as errors. -
ses()andses.Tstats()no longer produce non-conformable array errors when the number of communities equals the number of traits (square observed matrix), as the permutation dimension of the null model is now detected automatically. -
sum_Tstats()withtype = "percent"ortype = "all"no longer errors when traits containNAvalues. - Add test suite with testthat