Tidy Ecology
  • Start here
  • Course
  • Topics
    • R for ecologists
    • Species diversity
    • Ordination
    • Occupancy modelling
    • Capture-recapture
    • Movement ecology
    • Population models
    • Species coexistence
    • Ecological time series
    • Causal inference
    • Evolutionary game theory
    • Quantitative genetics
    • Population genetics
    • Landscape connectivity
    • Conservation decisions
    • Bayesian computation
    • Reproducible workflows
    • Data provenance checks
  • Blog
  • About
  • Contact

N 46.77° · E 23.59° · R + QGIS

R & QGIS tutorials
for ecologists.

Field data, cleanly analysed: reproducible R & QGIS workflows for ecologists who'd rather spend their time on the ecology than on fighting their tools.

Latest tutorials ↓

// Latest

PET-PEESE and publication bias under heterogeneity
R
meta-analysis
publication bias
simulation
ecology tutorial

PET-PEESE removes publication bias that grows with the standard error, not a significance filter on studies that differ by site. Measured in base R simulations.

Sep 18, 2026
The mid-domain effect as a null for richness
R
macroecology
null models
species richness
simulation
ecology tutorial

A range-shuffling mid-domain null fits a central environmental hump with r-squared near 0.9. An envelope and a species midpoint test in R tell geometry apart.

Sep 18, 2026
Flight-season shifts and false occupancy trends
R
occupancy
phenology
imperfect detection
citizen science
simulation
ecology tutorial

A flight season moving towards the edge of a fixed recording window gives a false occupancy decline that a year term on detection misses. Simulated in R.

Sep 18, 2026
Harvest surveys and the late respondent
R
survey design
non-response
harvest monitoring
simulation
ecology tutorial

Wave extrapolation in a hunter harvest survey removes some respondent bias, but the returned forms cannot show how much. Checking it in R against a follow-up.

Sep 18, 2026
Pollen rate of change and uneven sample spacing
R
palaeoecology
pollen
time series
simulation
ecology tutorial

Pollen rate of change on unevenly spaced cores peaks at short gaps. Simulated in R: pooled time bins find a large turnover, one level per bin mostly does not.

Sep 18, 2026
Sediment quality guidelines from co-occurrence
R
ecotoxicology
sediment quality
logistic regression
simulation
ecology tutorial

At a correlation of 0.8, an inert chemical passes the ERL/ERM reliability check in contaminated databases and the real toxicant fails it in clean ones. R.

Sep 18, 2026
Lost collar signals and informative censoring
R
survival analysis
telemetry
censoring
simulation
ecology tutorial

When dead animals silence their collars, Kaplan-Meier survival runs high. Testing in R how far a battery-life likelihood and a cut-off rule can be trusted.

Sep 18, 2026
Interaction rewiring and its sampling floor
R
ecological networks
species interactions
pollination
permutation tests
ecology tutorial

Two samples of one pollination web differ, and Poisot’s partition calls that rewiring. The sampling floor in closed form, and a permutation test on bouts.

Sep 17, 2026
Extrapolating a species-area curve beyond the plots
R
species richness
biogeography
macroecology
simulation
ecology tutorial

A power law fitted to small nested plots wins on AIC yet misjudges richness at larger areas, by a factor set by aggregation and pool saturation. Tested in R.

Sep 17, 2026
Revisits triggered by sightings in occupancy data
R
occupancy
imperfect detection
citizen science
simulation
ecology tutorial

Revisits after a recorded sighting leave occupancy unbiased; revisits led by local knowledge inflate it. Tested in R, with a visit-count repair that can fail.

Sep 17, 2026
Likert items: when group means lie
R
questionnaires
ordinal data
human dimensions
simulation
MASS
ecology tutorial

A polarised stakeholder group can score lower on a 1 to 5 item with the same mean attitude. Simulating in R how t tests and polr fail, and a scale model holds.

Sep 17, 2026
Tuning proxy records manufactures synchrony
R
palaeoecology
time series
simulation
ecology tutorial

Shifting tie points within dating error makes independent proxy records correlate, and an effective sample size test often still passes them. Tested in R.

Sep 17, 2026
Integrated biomarker response and axis order
R
ecotoxicology
biomarkers
composite indices
simulation
ecology tutorial

The axis order of an IBR star plot can change the most impacted station, but a repeat survey changes it more often. Measured in R against a mean of z-scores.

Sep 17, 2026
Classifying migrants from net squared displacement
R
movement ecology
migration
model selection
simulation
ecology tutorial

Choosing net squared displacement curves by AIC labels stationary home-range residents as migrants more often the slower they roam. Floors and AR(1) fits in R.

Sep 17, 2026
Summed radiocarbon dates: an honest, nearly blind test
R
radiocarbon
palaeoecology
null models
simulation
ecology tutorial

A summed probability distribution of radiocarbon dates is spiky even for a constant population. The Monte Carlo test holds its level but has little power, in R.

Sep 16, 2026
Year trends in effect sizes and the SE covariate
R
meta-analysis
meta-regression
publication bias
simulation
ecology tutorial

A decline in effect size with publication year can be an artefact of growing samples. Measuring in R what the standard error covariate costs and which to use.

Sep 16, 2026
Size measurement error in an IPM
R
integral projection models
measurement error
demography
simulation
ecology tutorial

Error in measured plant size pushes an integral projection model’s lambda upwards. Where in R the bias enters the kernel, and a remeasurement repair for it.

Sep 16, 2026
Fire return intervals from a short scar record
R
fire ecology
survival analysis
simulation
ecology tutorial

With random fires, a mean fire interval from a short fire-scar record runs short, censoring both open gaps overshoots, and fire counts err less. Tested in R.

Sep 16, 2026
Model discrepancy in simulator calibration
R
simulation models
Gaussian processes
calibration
model misspecification
ecology tutorial

Calibrating a linear intake simulator against a saturating truth in R: a GP discrepancy stays honest only while its amplitude is set from outside the data.

Sep 16, 2026
Heatwave counts: persistence, rule order, warming
R
climate
extremes
time series
simulation
ecology tutorial

How many heatwaves a year depends on persistence and on the order of the duration and gap rules. Simulating the Hobday marine heatwave definition in R.

Sep 16, 2026
Related founders and marker kinship in a studbook
R
conservation genetics
captive breeding
population genetics
simulation
ecology tutorial

Studbooks that treat related founders as unrelated overstate diversity; it costs breeding decisions only when sib groups differ in size. Markers tested in R.

Sep 16, 2026
Prediction intervals for a new site in meta-analysis
R
meta-analysis
heterogeneity
simulation
ecology tutorial

A random-effects prediction interval is meant to cover the effect at a new site 95 per cent of the time. Measured in R across study counts, tau and estimators.

Sep 15, 2026
Attributing one bad year to a warming trend
R
extreme value theory
climate change
selection bias
simulation
ecology tutorial

Keeping the extreme year that triggered an attribution study in a normal trend fit inflates the probability ratio; in a GEV the shape absorbs it. R simulation.

Sep 15, 2026
Germination trials as time-to-event data
R
seed ecology
survival analysis
censoring
simulation
ecology tutorial

A slower seed lot reads as less viable when only the final count is tested. Fitting germination trials as interval-censored data with a cure fraction in R.

Sep 15, 2026
Synthetic likelihood for noisy population dynamics
R
synthetic likelihood
approximate Bayesian computation
population dynamics
simulation
ecology tutorial

Fitting a chaotic Ricker model to Poisson counts in R with Wood’s synthetic likelihood: skeleton fits, simulations per point, and coverage against ABC.

Sep 15, 2026
Bout-ending criteria and the histogram bin width
R
animal behaviour
biologging
mixture models
maximum likelihood
simulation
ecology tutorial

A bout-ending criterion fitted to binned log frequencies moves with bin width and sample size. Simulating behaviour bouts in R; the likelihood fit holds steady.

Sep 15, 2026
Genetic rescue: how many migrants, for how long
R
conservation
population genetics
extinction
simulation
ecology tutorial

Genetic rescue in R: a migrant pulse only delays extinction of an inbred isolate, one a generation holds it off while it lasts, and migrant ancestry runs high.

Sep 15, 2026
Rapoport’s rule and the Stevens method
R
macroecology
biogeography
range size
simulation
ecology tutorial

Stevens’ band-mean method finds Rapoport’s rule in worlds with none, and pole clipping biases the species midpoint method too. Edge treatments tested in R.

Sep 14, 2026
Latency tests when some animals never respond
R
survival analysis
animal behaviour
simulation
ecology tutorial

Novel-object latency tests with non-responders mix two effects. Measuring in R how Cox, t tests and a mixture cure model read more responders or faster ones.

Sep 14, 2026
Two imperfect tests and no gold standard
R
disease ecology
diagnostic tests
latent class models
simulation
ecology tutorial

Fitting the Hui-Walter latent class model in R: why Wald intervals undercover, when profile intervals keep coverage, and why test dependence cannot be seen.

Sep 14, 2026
Fitting an ODE: trajectory versus gradient matching
R
population dynamics
differential equations
model fitting
simulation
ecology tutorial

Fitting Lotka-Volterra ODEs to noisy counts in R: random starts miss the best fit half the time, and gradient matching gives a start that fails as samples thin.

Sep 14, 2026
Geolocator latitude near the equinox
R
movement
geolocation
simulation
ecology tutorial

Light-level geolocators turn daylength into latitude. Simulating in R how canopy shading, the equinox and Hill-Ekstrom calibration bend a songbird track.

Sep 14, 2026
Mean kinship breeding in a captive population
R
conservation genetics
population genetics
captive breeding
simulation
ecology tutorial

Mean kinship breeding keeps more founder diversity than equal family sizes only when founders start unequal; unknown sires as founders undo much of it. In R.

Sep 14, 2026
Trawl selectivity when hauls differ
R
fisheries
selectivity
GLM
overdispersion
simulation
ecology tutorial

Pooling covered-codend hauls into one logistic selectivity curve gives an L50 interval that misses. Why quasi-binomial fails in R, and why the haul is the unit.

Sep 13, 2026
Instrument drift, run order and check standards
R
laboratory data
experimental design
simulation
ecology tutorial

Samples run through an analyser in treatment order turn instrument drift into an effect. Measuring in R what check standards fix and what run order does.

Sep 13, 2026
Negative binomial k from small host samples
R
parasitology
count data
simulation
ecology tutorial

From 15 to 40 hosts the aggregation k often has no finite estimate. Measuring in R how the rule for those samples creates false k-burden relationships.

Sep 13, 2026
Omitted random slopes and false positives
R
mixed models
nlme
type I error
simulation
ecology tutorial

A random intercept model that leaves out a real random slope finds a mean effect that is not there. Measuring in R why the slope variance test cannot warn you.

Sep 12, 2026
Detecting a die-off from carcass reports
R
surveillance
wildlife disease
negative binomial
simulation
ecology tutorial

A historical-limits alarm on weekly carcass reports: the variance model sets the real false alarm rate, and decides detection when noise varies by season. In R.

Sep 12, 2026
Infection rates from pooled vector samples
R
disease ecology
group testing
simulation
ecology tutorial

Pooled PCR of mosquitoes within trap-nights biases the pool MLE low and its interval undercovers. Simulating in R what randomising the pools can and cannot fix.

Sep 12, 2026
Map accuracy and false fragmentation
R
landscape ecology
remote sensing
simulation
ecology tutorial

At one overall accuracy a land-cover map can give eight times the true patch count or nearly the right one. Which errors do that, and what filters cost, in R.

Sep 11, 2026
Meta-analysis of little-replicated experiments
R
meta-analysis
response ratio
simulation
ecology tutorial

Three bottles per arm make the variance of a log response ratio an estimate too. Measuring in R what that does to coverage, tau-squared and Egger’s test.

Sep 11, 2026
Habitat amount versus fragmentation per se
R
landscape ecology
fragmentation
GLM
simulation
ecology tutorial

A bird tracking only forest amount gains a false edge density effect once amount enters a GLM as a straight line. Measuring in R which model or design fixes it.

Sep 11, 2026
Spike tests on logger data delete real peaks
R
data cleaning
monitoring
time series
simulation
ecology tutorial

Spike tests on logger data delete storm surges that span few readings. Running-median and three-point tests, geometry and simulation by logging interval, in R.

Sep 10, 2026
Density or frequency transmission in enclosures
R
disease ecology
epidemiology
GLM
experimental design
simulation
ecology tutorial

Enclosure trials tell density- from frequency-dependent transmission apart only over a wide range of group sizes. A cloglog GLM, its interval and repairs in R.

Sep 10, 2026
Biotic index scores and sorting effort
R
bioassessment
monitoring
freshwater
simulation
ecology tutorial

Average-score biotic indices drift with the number of animals sorted when sensitive families are rarer, so clean sites get flagged. Measured in R, with repairs.

Sep 10, 2026
Borrowed age-length keys and strong year classes
R
fisheries
age structure
EM
simulation
ecology tutorial

An age-length key borrowed from another year halves a strong year class. In R: the exact forward bias, the inverse EM key, and where a growth curve fixes it.

Sep 9, 2026
Reset time and the double-counted hot day
R
temperature
climate
data quality
simulation
ecology tutorial

A min-max thermometer reset in the afternoon counts hot afternoons twice. Simulating time-of-observation bias in R: its size, its cause and its correction.

Sep 9, 2026
Growth from tag-recapture increments
R
growth
fisheries
capture-recapture
measurement error
nonlinear regression
simulation
ecology tutorial

Fabens fits to tag-recapture increments do not estimate the length-at-age curve. Measuring in R how asymptote spread and length error bias Linf and K.

Sep 9, 2026
Checking a phylogenetic regression’s branch lengths
R
phylogenetics
comparative methods
model diagnostics
simulation
ecology tutorial

Wrong branch lengths make PGLS find slopes that are not there. How often the Garland check notices, on coalescent and Yule trees of 20 to 80 species, in R.

Sep 8, 2026
Patches cut by the edge of the map
R
landscape ecology
patch metrics
edge correction
simulation
ecology tutorial

Mean patch size from a map window is biased low, and dropping border patches is worse. Measuring the Miles-Lantuejoul edge correction for habitat patches in R.

Sep 8, 2026
Faecal egg count reduction tests at low counts
R
parasitology
disease ecology
bootstrap
simulation
ecology tutorial

At McMaster egg counts a drug that works 99 per cent usually reads as 100 and its interval collapses. Coverage and resistance calls are measured in R.

Sep 8, 2026
Removal estimates when catchability falls
R
abundance
detection
fisheries
simulation
ecology tutorial

When fish get harder to catch on each electrofishing pass, the Zippin removal estimate runs low and its interval fails. Measuring the bias and a repair in R.

Sep 7, 2026
Sap flow and the zero-flow baseline
R
ecophysiology
sap flow
measurement error
simulation
ecology tutorial

Thermal dissipation sap flow needs a zero-flow baseline. Simulating in R how night transpiration and probe noise bias tree water use under each baseline rule.

Sep 7, 2026
Detecting sex-biased dispersal from genotypes
R
population genetics
dispersal
permutation test
simulation
ecology tutorial

Testing sex-biased dispersal in R with Fst and assignment indices: calibrated permutation tests and why power is signal over noise, not immigrant counts.

Sep 7, 2026
Leaf area from gap fraction: the segment length
R
leaf area index
canopy
remote sensing
simulation
ecology tutorial

Inverting canopy gap fraction to leaf area index in R: why long segments underestimate a clumped canopy, and why short ones saturate. Choosing segment length.

Sep 6, 2026
Carcass searches and fatality estimates
R
mortality
imperfect detection
simulation
ecology tutorial

Fatality totals from carcass searches depend on whether missed carcasses stay findable. Shoenfeld and Huso bracket the truth when persistence is right, in R.

Sep 6, 2026
Heterozygosity-fitness correlations and power
R
population genetics
inbreeding
statistical power
simulation
ecology tutorial

Simulate heterozygosity-fitness correlations in R: how often a dozen microsatellites detect real inbreeding depression, and what the g2 test can and cannot say.

Sep 6, 2026
Extra-pair paternity from parentage mismatches
R
population genetics
parentage
genotyping error
simulation
ecology tutorial

A fixed mismatch rule turns genotyping error into extra-pair paternity as loci are added. Measuring in R the brother problem and two repairs that fit the rate.

Sep 5, 2026
Sequential sampling for pest decisions
R
sampling
count data
decision analysis
simulation
ecology tutorial

A Wald sequential plan decides whether to spray after every plant, but its boundaries contain the negative binomial k. Checking the plan by simulation in R.

Sep 5, 2026
Extinction dates from sighting records
R
extinction
conservation
simulation
statistics
ecology tutorial

Dating extinctions from sighting records in R: the Solow test’s false alarm rate in closed form, and how often the linear estimation bound misses a decline.

Sep 5, 2026
Chamber fluxes: linear or exponential fits
R
soil respiration
greenhouse gas flux
nonlinear regression
simulation
ecology tutorial

Closed chamber fluxes in R: the linear slope’s bias is a formula, while four syringe samples leave an exponential fit scattered and model choice adds error.

Sep 4, 2026
Temporal Ne with overlapping generations: plan II bias
R
population genetics
effective population size
simulation
ecology tutorial

Temporal Ne from cohorts a few years apart can be negative. An R simulation shows the Waples 1989 plan II term sets the bias, and when adding it back works.

Sep 4, 2026
Fertility control versus culling in R
R
population dynamics
wildlife management
density dependence
simulation
ecology tutorial

Culling and permanent sterilisation at the same treatment rate share one long-run population. Measuring in R the years and animals handled that separate them.

Sep 4, 2026
Light response curves: the curvature you drop
R
photosynthesis
nonlinear regression
model selection
simulation
ecology tutorial

Fitting photosynthesis light response curves in R: the rectangular hyperbola’s bias is arithmetic, but ten noisy points rarely show it or pin down curvature.

Sep 3, 2026
Bateman gradients from genetic parentage
R
sexual selection
parentage
simulation
ecology tutorial

Counting a female’s mates as the sires found among her offspring builds a Bateman gradient with no benefit of mating. Simulating the artefact in R and its size.

Sep 3, 2026
Declaring eradication after empty traps
R
eradication
invasive species
removal sampling
detection
simulation
ecology tutorial

A run of empty trap sessions sized from the removal capture rate is calibrated only when every animal is equally catchable. Testing eradication rules in R.

Sep 3, 2026
Fishing, age truncation and spawning variability
R
fisheries
population dynamics
age structure
time series
simulation
ecology tutorial

Fishing old fish raises the CV of spawning output by a closed-form filter. In R: a 50-year survey index often misses it; the naive variance test is oversized.

Sep 2, 2026
Reference sites and tolerance bounds
R
bioassessment
monitoring
statistics
simulation
ecology tutorial

Tolerance bounds versus percentiles for impairment thresholds from reference sites in R: the false alarm guarantee, its cost in power, and skewed indices.

Sep 2, 2026
Open N-mixture models and the detection trap
R
abundance
imperfect detection
population dynamics
simulation
ecology tutorial

Open N-mixture models in R: a hand-coded forward algorithm fits survival and recruitment to repeat counts, and tests which detection errors the visits catch.

Sep 2, 2026
Distributed lag models versus the climate window
R
mgcv
GAMs
climate
time series
simulation
ecology tutorial

A smooth climate effect over 52 weekly lags, a searched window and an mgcv distributed lag model in R: interval coverage for the total and where the peak sits.

Sep 1, 2026
Net primary production from repeated harvests
R
primary production
grassland
sampling
simulation
ecology tutorial

Harvest ANPP depends on the estimator. Simulating in R how noisy clip means inflate summed increments and peak standing crop, and how tissue turnover hides.

Sep 1, 2026
Individual growth curves with nlme
R
nlme
mixed models
nonlinear regression
growth
simulation
ecology tutorial

Averaging per-fish nls fits overstates how much fish differ in asymptotic length when ages stop short. Individual von Bertalanffy growth curves in R with nlme.

Sep 1, 2026
Patch-leaving rules and prey clumping
R
foraging
behaviour
simulation
ecology tutorial

Fixed number, fixed time or giving-up time: which patch-leaving rule pays depends on how prey are spread among patches. Measured in R for a blind forager.

Aug 31, 2026
Observer effects and the first-year dip
R
monitoring
trend
GLM
observer effects
ecology tutorial

Adding an observer effect to a route count trend turns a novice first-year deficit into a spurious increase. Measuring the bias and the one-term fix in R.

Aug 31, 2026
Rock-paper-scissors needs local interaction
R
community ecology
evolutionary game theory
spatial ecology
simulation
survival
ecology tutorial

A well-mixed rock-paper-scissors community soon loses a type; small neighbourhoods on a 40 by 40 lattice keep all three. Censored extinction times in R.

Aug 31, 2026
Critical patch size and the dispersal kernel
R
dispersal
population dynamics
spatial ecology
simulation
ecology tutorial

Critical patch size in R: eigenvalues show a peaked dispersal kernel needs less habitat than a Gaussian, and demographic noise lifts the practical threshold.

Aug 30, 2026
NOEC rewards noisy toxicity tests
R
ecotoxicology
dose-response
hypothesis testing
simulation
ecology tutorial

The NOEC rises with residual scatter and falls with replication, while a fitted EC10 stays centred on the truth. Both measured on simulated toxicity tests in R.

Aug 30, 2026
Ratio indices or ANCOVA for body size
R
ANCOVA
allometry
physiology
simulation
ecology tutorial

Dividing organ mass by body mass invents group effects when fish differ in size. Measuring in R when ratio indices fail, and when ANCOVA fits the wrong curve.

Aug 30, 2026
Within- and between-individual effects in R
R
mixed models
nlme
centring
behavioural ecology
simulation
ecology tutorial

A random intercept slope blends within- and between-female effects. Centring in R with nlme separates them, and why a few records bias the between slope.

Aug 29, 2026
Deleting outliers before the test
R
regression
hypothesis testing
simulation
statistics
ecology tutorial

Dropping points with large standardised residuals or Cook’s distance, then refitting, is a test with its own error rate. Measured in R on null regressions.

Aug 29, 2026
Evolutionary rescue and starting population size
R
evolutionary ecology
quantitative genetics
extinction
simulation
ecology tutorial

Evolutionary rescue in R: a branching process and an individual-based model show even odds need a Gomulkiewicz-Holt minimum of 5 to 15 individuals, not one.

Aug 29, 2026
Red noise and extinction risk in a Ricker model
R
population dynamics
extinction
stochastic simulation
time series
ecology tutorial

At equal variance, red environmental noise raises extinction risk for an undercompensating Ricker population and lowers it for an overcompensating one, in R.

Aug 28, 2026
Zeros and ones in beta regression
R
beta regression
proportions
censoring
simulation
ecology tutorial

The usual squeeze for exact zeros and ones makes a beta regression slope depend on sample size. Measuring it in R, with censored and inflated beta models.

Aug 28, 2026
Pitfall catches and the depletion zone
R
pitfall traps
sampling
movement ecology
simulation
ecology tutorial

A pitfall keeps what it catches, so nearby beetles thin out. Simulating in R how that depletion zone bends the effort offset and how diffusion sets its size.

Aug 28, 2026
Line transects along tracks and avoidance
R
distance sampling
abundance
survey design
model checking
ecology tutorial

Line transects on tracks animals avoid: a half-normal fit can lose over half the density, and the fit test mostly misses the costliest gradients. In R.

Aug 27, 2026
Acoustic indices and species richness
R
bioacoustics
acoustic monitoring
biodiversity
simulation
ecology tutorial

Acoustic entropy and the ACI on simulated spectrograms in R: the sign of their link to species richness follows the noise floor, call energy and note length.

Aug 27, 2026
Quadrat variance peaks and false second scales
R
spatial pattern
quadrat variance
statistics
ecology tutorial

TTLQV and paired quadrat variance on transects with one patch scale: how often a second peak appears, where it lands, and why a peak count is not a scale count.

Aug 27, 2026
Harmonics or cyclic splines for a narrow seasonal peak
R
phenology
GAMs
mgcv
time series
ecology tutorial

Cyclic splines in mgcv for a narrow seasonal peak in counts: harmonics chosen by AIC or BIC against s(day, bs = ‘cc’), and the New Year jump of a plain smooth.

Aug 26, 2026
Multilevel post-stratification of records
R
mgcv
citizen science
survey design
hierarchical models
ecology tutorial

Citizen-science records leave remote cells empty. Measuring in R how raw post-stratification, a main-effects GLM and MRP in mgcv recover a frame prevalence.

Aug 26, 2026
Angle-count sampling for basal area
R
forest inventory
survey design
sampling
simulation
ecology tutorial

Bitterlich angle counts sample trees in proportion to basal area. In R: the closed-form precision trade-off, how clumping shrinks it, and borderline-tree bias.

Aug 26, 2026
Log-linear models for three-way count tables
R
GLM
contingency tables
log-linear models
simulation
ecology tutorial

A three-way table of nest counts fitted as nested Poisson GLMs in R: marginal versus conditional independence, and which term guarantees a safe collapse.

Aug 25, 2026
Brownian motion or Ornstein-Uhlenbeck?
R
phylogenetics
comparative methods
model selection
simulation
ecology tutorial

Brownian traits on a phylogeny pick an Ornstein-Uhlenbeck model by AICc in about one dataset in seven, bigger trees or not; tip error makes it worse. In R.

Aug 25, 2026
Interval-censored survival from visit data
R
survival analysis
censoring
survival
simulation
ecology tutorial

Coding a death found on a tracking visit at the interval midpoint can flip a falling hazard into a rising one. Fitting interval-censored Weibull survival in R.

Aug 25, 2026
Pretesting variances before a t test
R
hypothesis testing
simulation
statistics
ecology tutorial

Checking equal variances before choosing the pooled t test is a test with its own error rate. Measured in R: passing the pretest makes the pooled t less safe.

Aug 24, 2026
Dirichlet-multinomial models for read counts
R
metabarcoding
overdispersion
simulation
diet analysis
ecology tutorial

Why a multinomial interval for a metabarcoding diet share is too narrow, and how the Dirichlet-multinomial in R turns deep libraries into a few hundred reads.

Aug 24, 2026
Self-exciting events and the Hawkes process
R
point processes
time series
acoustic monitoring
statistics
ecology tutorial

A clustered event series fits a Hawkes process and a changing background rate alike. Simulating, fitting and checking both in R shows when time separates them.

Aug 24, 2026
Species synchrony and community stability
R
community ecology
stability
synchrony
simulation
ecology tutorial

The Loreau-de Mazancourt synchrony index splits community variability exactly. Simulating in R how synchrony and mean-variance scaling set the diversity slope.

Aug 23, 2026
Spatial synchrony and the Moran effect
R
population dynamics
time series
spatial synchrony
simulation
ecology tutorial

Shared weather gives populations its correlation only under narrow conditions, and dispersal synchrony depends on whether regulation cycles. Moran effect in R.

Aug 23, 2026
Seasonal matrix models and the census date
R
population dynamics
matrix models
demography
conservation
ecology tutorial

Lambda from a seasonal matrix model does not depend on the census date, but the annual matrix and its elasticities do. Periodic sensitivity analysis in R.

Aug 23, 2026
Census interval bias in tree mortality rates
R
survival analysis
forest dynamics
demography
simulation
ecology tutorial

Unseen differences in risk make annual tree mortality fall as the census interval lengthens. Measuring the bias in R with gamma frailty and a cohort of trees.

Aug 22, 2026
Identification errors in capture-recapture
R
capture-recapture
abundance
photo identification
simulation
ecology tutorial

A missed photo match inflates a capture-recapture estimate and a false match deflates it. Measuring in R why a cancelling pair still costs interval coverage.

Aug 22, 2026
Change-in-ratio population estimates in R
R
abundance
harvest
population ecology
ecology tutorial

Population size from a sex ratio measured before and after a known harvest. Why the estimate divides by the ratio change, and when it stops meaning anything.

Aug 22, 2026
Particle MCMC for state space models
R
Bayesian statistics
MCMC
state-space models
particle filter
population dynamics
ecology tutorial

A particle filter’s likelihood estimate is noisy but unbiased, so Metropolis-Hastings built on it samples the exact posterior. A Gompertz count model, in R.

Aug 21, 2026
Emulating a slow simulation model
R
simulation
Gaussian processes
computer experiments
ecology tutorial

A Gaussian process emulator from 64 runs of a harvest model in R: grid against Latin hypercube, leave-one-out checks, and a jitter that sets the coverage.

Aug 21, 2026
Derivatives of a GAM trend: when did it change?
R
GAMs
mgcv
trend
monitoring
thresholds
ecology tutorial

The derivative of a GAM trend with a simultaneous interval says when an ecological series declined. A breakpoint fitted to a smooth decline misplaces it.

Aug 21, 2026
Hierarchical GAMs and factor smooths in mgcv
R
GAMs
mgcv
smoothing
hierarchical models
thermal ecology
ecology tutorial

A by smooth fits each population alone; a factor smooth shrinks it toward a shared curve. Measuring in R what that choice does to a sparsely sampled population.

Aug 20, 2026
Home vs away and local vs foreign in transplants
R
local adaptation
experimental design
interactions
simulation
ecology tutorial

Two criteria for local adaptation in a reciprocal transplant, the main effect each mistakes for adaptation, and why populations, not plants, are the replicate.

Aug 20, 2026
Checking published summary statistics
R
meta-analysis
reproducibility
statistics
ecology tutorial

A rounded mean or t value from a paper is a band, not a point. GRIM, SD bounds and recomputed p values in R, with the false alarms a missing sample creates.

Aug 20, 2026
Inclusion criteria move the pooled effect
R
meta-analysis
publication bias
research synthesis
simulation
ecology tutorial

An English-only screening rule shifts a pooled effect as the funnel plot and Egger test stay quiet. Measuring in R what inclusion rules do to a meta-analysis.

Aug 19, 2026
Data entry errors and what your checks catch
R
data cleaning
data entry
measurement error
monitoring
ecology tutorial

Simulating keying errors in a field table in R: range rules catch a third and leave a biased residue, but double entry catches most but leaves rare large ones.

Aug 19, 2026
Curve registration and functional PCA
R
functional data
phenology
PCA
smoothing
ecology tutorial

Averaging shifted flowering curves flattens the peak. Registration in R by shift or pinned warp decides what a functional PCA of the season calls amplitude.

Aug 19, 2026
Depth sensor drift and the dive count
R
biologging
diving behaviour
measurement error
simulation
ecology tutorial

A slowly drifting pressure sensor zero changes the dive count of an unchanged animal. Simulating a dive record in R, predicting the loss, correcting the zero.

Aug 18, 2026
Tree ring detrending and the segment length curse
R
dendrochronology
time series
palaeoecology
detrending
ecology tutorial

Detrending tree ring series removes climate at periods longer than each series. Measuring the segment length curse, EPS and regional curves for ecologists in R.

Aug 18, 2026
Accelerometer windows and short behaviours
R
accelerometry
animal behaviour
classification
MASS
simulation
ecology tutorial

Window length sets a ceiling on which short behaviours accelerometer data can detect. Measuring ODBA, VeDBA and LDA classification in R for animal behaviour.

Aug 18, 2026
Spatial+ and the attenuated slope
R
GAMs
mgcv
spatial
spatial confounding
simulation
ecology tutorial

Adding a spatial smooth to a GAM moves a confounded slope only part of the way back. Spatial+ in R with mgcv, and the plot-level variation it needs to work.

Aug 17, 2026
Separable space-time covariance, tested
R
spatial
time series
covariance
simulation
ecology tutorial

A separable space-time covariance turns one Cholesky into a Kronecker product, but fixes one spatial range for every time lag. Measuring the cost in R.

Aug 17, 2026
Conditional simulation versus kriging
R
spatial
geostatistics
simulation
ecology tutorial

A kriged map is the best guess cell by cell but too smooth for the area above a threshold, the peak or the patch count. Conditional simulation in base R.

Aug 17, 2026
Random effects with too few levels
R
mixed models
variance components
simulation
ecology tutorial

With five streams the variance component is most often exactly zero. Measuring in R why dropping that singular random term barely harms a group-level test.

Aug 16, 2026
Join counts for presence-absence maps
R
spatial statistics
autocorrelation
presence-absence
permutation tests
ecology tutorial

Join counts test clustering on a presence-absence grid. Measuring in R which variance fails, and why a map with few occupied cells needs a permutation test.

Aug 16, 2026
Records as a test for trend
R
trend
monitoring
statistics
ecology tutorial

The expected number of record years in an independent series is a harmonic number, whatever the distribution. Testing ecological trends with records in R.

Aug 16, 2026
Aggregation and host parasitoid stability
R
population dynamics
host-parasitoid
stability
ecology tutorial

Why the Nicholson-Bailey host parasitoid equilibrium is unstable at every parameter: eigenvalue modulus in R, and the aggregation threshold that stabilises it.

Aug 15, 2026
The jackknife and bias correction
R
resampling
statistics
diversity
ecology tutorial

The jackknife removes bias, it does not build intervals. See its pseudo-values cancel the one over n term in a diversity index, and then fail on a median in R.

Aug 15, 2026
Island biogeography and turnover
R
biogeography
species richness
community ecology
ecology tutorial

Simulate the MacArthur and Wilson equilibrium in R: island richness settles while the species list keeps changing, and turnover depends on the survey gap.

Aug 15, 2026
Resource competition and the R-star rule
R
competition
coexistence
theoretical ecology
ecology tutorial

Tilman resource competition in R: a hand written RK4 chemostat shows why the lowest equilibrium resource level wins, and when two resources allow coexistence.

Aug 14, 2026
Testing a fitted distribution
R
goodness of fit
model checking
resampling
ecology tutorial

Kolmogorov-Smirnov and Anderson-Darling go badly conservative once parameters are estimated. Measure the damage in R and repair it with a parametric bootstrap.

Aug 14, 2026
The paradox of enrichment in R
R
theoretical ecology
population dynamics
predation
ecology tutorial

Enrichment in R: a Rosenzweig-MacArthur model integrated by hand, the Hopf point located twice, and a limit cycle trough far below one surviving animal.

Aug 14, 2026
Daylength as a predictor in ecology
R
phenology
photoperiod
simulation
ecology tutorial

Compute photoperiod in base R and test it: at one site daylength cannot beat day of year for phenology, and across latitudes it carries the climate gradient.

Aug 13, 2026
Taylor’s power law and how many quadrats
R
sampling design
count data
spatial ecology
ecology tutorial

Variance scales with the mean as a power law, and the exponent prices a survey. Fit it in R, turn it into quadrat counts, and watch it move with grain.

Aug 13, 2026
Network robustness and secondary extinctions
R
ecological networks
extinction
statistics
ecology tutorial

Attack tolerance curves and R50 for pollination webs in base R, showing that R50 is a joint property of the web, the removal order and the dependence rule.

Aug 13, 2026
Observer agreement and Cohen’s kappa in R
R
measurement error
survey design
statistics
ecology tutorial

Per cent agreement flatters two surveyors, and Cohen’s kappa moves with class prevalence. Simulate both in base R and weight kappa for ordered cover classes.

Aug 13, 2026
Estimating plant cover with point intercepts
R
survey design
vegetation
statistics
ecology tutorial

A 100-pin frame is not 100 independent samples. Simulation shows how patchy vegetation shrinks the effective sample size and sinks the interval’s coverage.

Aug 13, 2026
Plotless density estimation from distances
R
spatial
point patterns
sampling
ecology tutorial

Convert point-to-tree distances into density in base R: why the nearest-tree estimator fails on clustered woodland, and how far T-square sampling repairs it.

Aug 13, 2026
Back-transforming a log-scale model
R
regression
allometry
statistics
ecology tutorial

Exponentiating a log-scale biomass equation returns the median tree, not the mean one, so stand totals come out low. Two corrections, and when each fails.

Aug 13, 2026
Observed power tells you nothing
R
hypothesis testing
study design
statistics
ecology tutorial

Power computed from the effect you observed is a one-to-one function of the p value, so it cannot say whether a non-significant study was underpowered.

Aug 12, 2026
GEE or a mixed model? Marginal and conditional
R
mixed models
GLM
lme4
ecology tutorial

A GEE estimates the population-averaged effect and a GLMM the site-specific one. On a logit link they differ by a known factor; on a log link they do not.

Aug 12, 2026
The scale of effect in landscape data
R
terra
spatial
landscape ecology
model selection
ecology tutorial

Fitting the same model at many buffer radii always returns a best one. The search inflates the error rate, and the landscape’s grain limits how well it works.

Aug 12, 2026
Slope and aspect: what a DEM does not measure
R
terra
spatial
raster data
ecology tutorial

Slope depends on the neighbourhood rule and the cell size, both through surface roughness, and aspect is an angle that must be split into two components.

Aug 12, 2026
What a shapefile loses: names, times and types
R
sf
spatial
data management
ecology tutorial

A shapefile round trip returns the geometry exactly and then rewrites the attribute table: names abbreviated, the clock dropped, logicals made integer.

Aug 12, 2026
Georeferencing RMS is not accuracy
QGIS
R
terra
GIS
spatial
ecology tutorial

The QGIS Georeferencer reports the residual at its own control points, not the accuracy of the result. Measured with GDAL on a sheet whose truth is known.

Aug 12, 2026
When redrawing zones flips the sign
R
spatial ecology
model diagnostics
ecology tutorial
ggplot2

Redrawing survey zones at a fixed unit count can reverse the sign of an ecological relationship. Measured in R, with the variance check that predicts it.

Aug 12, 2026
Selection models for publication bias
R
meta-analysis
publication bias
ecology tutorial

Fit the publication filter into the likelihood with base R, and measure how many ecological studies a weight-function selection model needs before it pays.

Aug 11, 2026
Running QGIS from the command line
R
QGIS
GIS
spatial
ecology tutorial

Scripting QGIS with qgis_process, and measuring where its algorithms match sf and terra exactly and where a different default moves an ecological number.

Aug 11, 2026
Coordinate error and habitat assignment
R
sf
GIS
spatial
ecology tutorial

Coordinate error flips a record’s habitat class at a rate set by the perimeter of the habitat map, not by the GPS. Measured in R with sf, on synthetic layers.

Aug 11, 2026
Rasterising a vector layer
R
terra
sf
GIS
ecology tutorial

Turning habitat polygons into a grid is a measurement with a rule: the cell centre rule drops narrow features, touches inflates them. Measured in R with terra.

Aug 11, 2026
Checking a vector layer before you measure
R
sf
GIS
spatial
ecology tutorial

A self-intersecting polygon has an area of exactly zero and sf says nothing. Eight geometry checks in R, each one measured on a synthetic habitat patch layer.

Aug 11, 2026
Choosing a projection for area and distance
R
sf
GIS
spatial
ecology tutorial

How the map projection you pick changes habitat area, patch density and nearest neighbour distance in sf, and why Web Mercator more than doubles an area.

Aug 11, 2026
The m out of n bootstrap
R
bootstrap
resampling
statistics
ecology tutorial

Subsampling in R: why a step changepoint interval rests on the convergence rate exponent, how to fit that exponent, and where the repair does harm instead.

Aug 11, 2026
Tensor product smooths in mgcv
R
mgcv
GAMs
spatial ecology
ecology tutorial

An isotropic s(x, z) on covariates with different scales hides a unit choice. Measuring what te() buys in mgcv, and when isotropy is the right claim to make.

Aug 10, 2026
Dichotomising a continuous predictor
R
causal inference
regression
simulation
ecology tutorial

Splitting a continuous confounder at its median leaves part of it unadjusted, so a null predictor can turn significant in ecological surveys. Measured in R.

Aug 10, 2026
Where the night-time flux comes from
R
eddy covariance
micrometeorology
carbon flux
ecology tutorial

Building the Schuepp flux footprint in base R to measure how far upwind an eddy covariance tower reads, and what a friction velocity screen does to the fetch.

Aug 10, 2026
Qst against Fst: is the trait under selection?
R
quantitative genetics
population genetics
simulation
ecology tutorial

Simulate the neutral drift null of Qst in R, measure how often it beats Fst by chance, and see why a one-sided Qst against Fst comparison is not a test.

Aug 10, 2026
Ecosystem multifunctionality and its threshold
R
biodiversity
ecosystem function
community ecology
ecology tutorial

The multifunctionality slope depends on the threshold you picked. Sweeping every threshold in R shows the whole curve, and why the averaging metric hides it.

Aug 10, 2026
What a detection time is worth
R
occupancy
survey design
detection probability
ecology tutorial

Occupancy visits record only detected or not detected, discarding the detection times. Measure in R, from exact Fisher information, what that choice costs.

Aug 10, 2026
Joint live-dead models: survival or fidelity?
R
capture-recapture
survival analysis
population ecology
ecology tutorial

Apparent survival from a live-only capture-recapture model is true survival times site fidelity. Adding dead recoveries in R separates the two, exactly.

Aug 10, 2026
Comparing two groups of angles
R
circular statistics
hypothesis testing
permutation tests
ecology tutorial

The Watson-Williams test fails on dispersed bearings, and permuting the angular gap does not repair it when mean resultant lengths are low, measured in base R.

Aug 9, 2026
Front-door adjustment when no instrument exists
R
causal inference
DAGs
mediation
ecology tutorial

Soil fertility confounds grazing and recruitment, and no instrument is available. A fully measured mechanism still identifies the total effect, in base R.

Aug 9, 2026
Combining species trends into one index
R
monitoring
biodiversity
time series
ecology tutorial

The arithmetic mean of species indices climbs when the average species is flat. Building a multi-species biodiversity indicator in R, and pricing the logs.

Aug 9, 2026
Time-varying covariates in a survival model
R
survival analysis
causal inference
ecology tutorial

An ever infected label creates immortal time and a false protective hazard ratio. Coding time-varying covariates as start-stop rows in R with survival.

Aug 9, 2026
Nonlinear selection gradients in R
R
evolutionary ecology
quantitative genetics
natural selection
ecology tutorial

Quadratic selection gradients in R: the regression coefficient is half the gradient, and fitting one trait at a time turns a saddle into disruptive selection.

Aug 9, 2026
Force of infection from age prevalence
R
disease ecology
epidemiology
GLM
ecology tutorial

A cloglog binomial GLM with a log age offset returns the force of infection directly. Fitting catalytic models to wildlife serology data in R, from scratch.

Aug 9, 2026
Dominance hierarchies from wins
R
behaviour
social structure
statistics
ecology tutorial

Proportion of wins ranks who an animal fought, not how good it is. David’s score, Bradley-Terry and Elo compared on a win matrix in base R, no packages.

Aug 9, 2026
Checking a matrix population model
R
population dynamics
demography
matrix models
ecology tutorial

Four checks on a population projection matrix before you read lambda off it: primitivity, reducibility, stage duration, and how wide the interval really is.

Aug 8, 2026
Fitting a body size spectrum
R
body size
power laws
statistics
ecology tutorial

Log bins shift the fitted size spectrum exponent by exactly one, and the likelihood never sees a bin. Fitting individual body mass data in R, no histogram.

Aug 8, 2026
Capture heterogeneity: Mt, Mb and Mh in R
R
capture-recapture
abundance
model diagnostics
ecology tutorial

Closed capture-recapture in R: the failures of constant capture probability cost different amounts. A trap response inflates abundance, heterogeneity cuts it.

Aug 8, 2026
Nested and crossed random effects in lme4
R
mixed models
experimental design
lme4
ecology tutorial

Plots numbered one to four inside every site make lme4 fit four plots, not forty eight. Here is what the wrong formula does to the variance components.

Aug 8, 2026
Weighted averaging transfer functions in R
R
palaeoecology
calibration
model diagnostics
ecology tutorial

Weighted averaging infers past pH from fossil assemblages, and it compresses the answer twice. Here is the deshrinking step and the analogue check it needs.

Aug 8, 2026
Permutation tests from scratch
R
hypothesis testing
statistics
ecology tutorial

A permutation test is called exact, and a Monte Carlo one has a floor it cannot report below. Here is where that floor sits and what it hides in ecology.

Aug 8, 2026
Checking a functional diversity analysis
R
functional diversity
traits
model diagnostics
ecology tutorial

Functional richness is measured in a trait space whose dimensions you chose. Adding one PCoA axis reorders the communities, and the winner usually changes.

Aug 8, 2026
Geographically weighted regression in R
R
spatial ecology
regression
model diagnostics
ecology tutorial

A coefficient map from GWR is drawn at a bandwidth you chose. On data with no spatial variation at all, a small one manufactures a map with sign reversals.

Aug 7, 2026
Quantifying phenological mismatch
R
phenology
climate change
trophic interactions
ecology tutorial

Warming can close the gap between peak demand and peak food while leaving consumers hungrier. The days between peaks is the wrong currency, measured in R.

Aug 7, 2026
Checking a point pattern analysis
R
point patterns
spatial ecology
null models
ecology tutorial

Simulation envelopes for Ripley’s K are not tests. The band most ecologists draw calls a third of random maps clustered, and more simulations do not help.

Aug 7, 2026
Stream metabolism from one oxygen logger
R
freshwater ecology
ecosystem fluxes
time series
ecology tutorial

One dissolved oxygen sensor gives whole stream production and respiration. On a deep, fast reach a correct model returns impossible fluxes a third of the time.

Aug 7, 2026
Elements of metacommunity structure: a stress test
R
metacommunities
null models
community ecology
ecology tutorial

The EMS decision key names a metacommunity from three statistics. Two are simulated, one is not, and the odd one out invents Clementsian boundaries in R.

Aug 7, 2026
Age-depth models and what they do to a proxy
R
palaeoecology
time series
uncertainty
ecology tutorial

A sediment core with a perfectly constant accumulation rate acquires a fluctuating influx record once dating error is turned into a chronology. Measured in R.

Aug 7, 2026
Dispersion checks when the counts are small
R
GLM
count data
model checking
ecology tutorial

Residual deviance over degrees of freedom is the standard overdispersion check, and on ecological count sizes it fails in both directions. Measured in R.

Aug 7, 2026
Two-species point patterns: testing for interaction
R
point patterns
spatial ecology
null models
ecology tutorial

Toroidal shift and random labelling ask different questions of two mapped species, and on shared habitat one of them fires over tenfold too often. Tested in R.

Aug 6, 2026
Soil carbon stocks and equivalent soil mass
R
soil carbon
monitoring
carbon accounting
ecology tutorial

Comparing soil carbon to a fixed sampling depth invents a difference whenever bulk density differs between treatments. The equivalent soil mass fix, in R.

Aug 6, 2026
Latent variables in an SEM, from scratch in R
R
structural equation models
measurement error
ecology tutorial

Soil fertility is not measured, three imperfect indicators are. A one-factor model recovers the slope that every composite of them gets wrong, in base R.

Aug 6, 2026
Values below the detection limit in R
R
censored data
monitoring
water quality
ecology tutorial

Substituting half the detection limit for a non-detect is not neutral, and a laboratory that improves over time turns a flat series into a decline. Worked in R.

Aug 6, 2026
What a CSV loses: archiving an R analysis
R
reproducibility
data management
ecology tutorial

A deposited CSV round-trips the numbers and drops the structure. The fit is identical to machine precision and the reported trend changes sign. Worked in R.

Aug 6, 2026
Ranking sites when every estimate is noisy
R
monitoring
shrinkage
prioritisation
ecology tutorial

League tables of survey sites are mostly noise: the top-ranked site is rarely the best one, and shrinkage improves the estimates without improving the order.

Aug 6, 2026
AIC with missing values: the silent row drop
R
model selection
AIC
missing data
ecology tutorial

R fits every model to whatever rows are complete for it, so an AIC table over covariates with different missingness ranks the gaps, not the ecology. Shown in R.

Aug 6, 2026
What a rank test actually tests
R
hypothesis testing
nonparametric statistics
ecology tutorial

The Wilcoxon rank sum test does not compare medians. It compares whole distributions, and with unequal spread it rejects when the medians agree. Simulated in R.

Aug 5, 2026
Testing for no effect: equivalence tests in R
R
hypothesis testing
equivalence
study design
ecology tutorial

A non-significant p value is not evidence of no effect. Two one-sided tests give ecologists a procedure that can support absence, with a worked simulation in R.

Aug 5, 2026
Checking an NMDS stress value
R
vegan
NMDS
ordination
community ecology
ecology tutorial

Stress thresholds for NMDS depend on how many sites you have, and unstructured data at eight sites scores good. A null envelope calibration in R with vegan.

Aug 5, 2026
Checking a community classification
R
vegan
PERMANOVA
cluster analysis
community ecology
ecology tutorial

Cluster the sites, cut the dendrogram, then test the clusters with PERMANOVA on the same matrix: pure noise passes almost every time. A calibrated null in R.

Aug 5, 2026
Power for a community study
R
vegan
PERMANOVA
community ecology
study design
ecology tutorial

How many plots does a PERMANOVA need? Simulation shows the answer depends on the dissimilarity index, which decides what counts as a community difference.

Aug 5, 2026
What SIMPER actually ranks
R
vegan
community ecology
multivariate
ecology tutorial

SIMPER ranks species by their contribution to Bray-Curtis dissimilarity, and a variable species with no group difference can win the table. Measured in R.

Aug 5, 2026
Implementing a plan while land is lost
R
conservation planning
decision analysis
ecology tutorial
ggplot2

A reserve plan bought two units a year for twenty years while land is cleared: the delivery gap, and the annual loss rate at which a myopic rule wins.

Aug 5, 2026
LiDAR height normalisation on slopes
R
LiDAR
remote sensing
forest structure
ecology tutorial

Normalising a LiDAR point cloud with a cell minimum invents metres of canopy on a slope. A simulation measures the bias and what it does to an ecological model.

Aug 4, 2026
Parasite burdens truncated by host death
R
parasitology
count data
selection bias
ecology tutorial

Hosts carrying the heaviest worm burdens die before the survey reaches them. Simulating that truncation in R and measuring what it does to the mean and to k.

Aug 4, 2026
Prevalence from an imperfect test
R
disease ecology
survey design
epidemiology
ecology tutorial

Correcting apparent prevalence in a wildlife disease survey: the Rogan-Gladen estimator, negative estimates, and intervals that carry the validation study.

Aug 4, 2026
Dependent effect sizes in meta-analysis
R
meta-analysis
effect size
heterogeneity
ecology tutorial

Most studies report several effect sizes, so they are not independent. A simulation prices the naive pooled fit, the three-level model and clustered errors.

Aug 4, 2026
Residuals as a variable: the two-step trap
R
regression
collinearity
model diagnostics
ecology tutorial

Residualising one predictor on another to dodge collinearity in R: what the two-step estimator really measures, and why its interval fails a coverage check.

Aug 4, 2026
Comparing significance is not a test
R
interactions
hypothesis testing
statistical power
ecology tutorial

Significant at one site and not at the other is not evidence that the sites differ. Measuring the fallacy rate in R, and the interaction test that replaces it.

Aug 4, 2026
Term order in unbalanced factorial ANOVA
R
ANOVA
linear models
experimental design
ecology tutorial

Unequal cell counts make anova() return different p-values for the same fitted model when the terms are reordered. A simulation measures how often it matters.

Aug 4, 2026
Slice sampling from scratch
R
MCMC
Bayesian statistics
ecology tutorial

Build a slice sampler in base R on an ecological count posterior, and measure the claim that it needs no tuning against a random-walk sampler that does.

Aug 3, 2026
Bridge sampling for marginal likelihoods
R
Bayesian statistics
MCMC
model selection
ecology tutorial

Estimating a marginal likelihood in base R: the harmonic mean measured against an exact answer, the bridge identity derived, and three ecological posteriors.

Aug 3, 2026
Reversible jump MCMC from scratch
R
Bayesian statistics
MCMC
model selection
ecology tutorial

Code a reversible jump sampler by hand in R to count abundance zones on a saltmarsh transect, and check its model probabilities against exact enumeration.

Aug 3, 2026
Checking a remote sensing covariate
R
terra
remote sensing
GLM
model checking
ecology tutorial

Five checks on a bird abundance model built from satellite NDVI: grid alignment, extraction scale, grain, composite timing, and the error a GLM treats as zero.

Aug 3, 2026
Filling cloud gaps in a satellite series
R
terra
remote sensing
missing data
ecology tutorial

Cloud gaps in a satellite NDVI series are not random: five fills scored in R against a known truth, and the ranking changes with the quantity you report.

Aug 3, 2026
Harmonic regression on a seasonal raster
R
remote sensing
time series
terra
ecology tutorial

Fit a sine and cosine pair per pixel to a year of NDVI composites in R, map amplitude and peak day, and measure what the raw seasonal maximum gets wrong.

Aug 3, 2026
NDVI time series from a raster stack
R
terra
remote sensing
phenology
ecology tutorial

Building a 46 layer NDVI cube in terra, the vector recycling trap that silently makes 1600 layers, per-pixel phenology with app, and how far a peak date drifts.

Aug 3, 2026
Decline estimates and Red List criterion A
R
conservation
IUCN
monitoring
ecology tutorial

Turning a monitored index into an IUCN criterion A reduction in R: a confidence interval on the decline, and how often the Red List category comes out wrong.

Aug 2, 2026
Testing a monitoring series every year
R
monitoring
multiple testing
trend
ecology tutorial

Retesting a monitoring trend every year inflates the false alarm rate more than sixfold. Simulation in R prices the damage and two boundaries that fix it.

Aug 2, 2026
Transporting an effect to a new region
R
causal inference
transportability
external validity
ecology tutorial

An effect measured in one valley is wanted for a whole region. Measuring the sign flip, the transport formula, the precision it costs and the two failures.

Aug 2, 2026
Checking an annual flux budget
R
eddy covariance
carbon flux
model checking
ecology tutorial

Six checks on a published eddy covariance carbon budget in R: friction velocity threshold spread, gap-filled half hours, and a defensible-choice multiverse.

Aug 2, 2026
Partitioning net flux into GPP and respiration
R
eddy covariance
carbon flux
GPP
ecology tutorial

Splitting eddy covariance net flux into GPP and ecosystem respiration in R: why both gross fluxes go wrong together while the annual net total stays right.

Aug 2, 2026
Gap filling a flux time series
R
missing data
time series
carbon flux
ecology tutorial

Eddy covariance gap filling in R: three missing-data mechanisms in a year of half-hourly net ecosystem exchange, five fills scored against a known budget.

Aug 2, 2026
Night-time flux and the u-star threshold
R
eddy covariance
carbon flux
data quality
ecology tutorial

A simulated year of half-hourly eddy covariance data measures the friction velocity filter: what it recovers, what it discards and what it costs a budget.

Aug 2, 2026
Robust regression for ecological outliers
R
regression
MASS
ecology tutorial

An outlier is a claim about the model, not about the point. Measuring leverage, breakdown points and the real price of robust regression on grassland data.

Aug 1, 2026
Tail dependence and joint extremes
R
extreme value theory
conservation
simulation
ecology tutorial

A correlation from the middle of a distribution says nothing about the corners. Simulating copulas in R to measure joint extreme risk in a reserve network.

Aug 1, 2026
Copulas for dependent ecological data
R
multivariate
simulation
ecology tutorial

Separating dependence from marginals in R: why skewed ecological data cannot reach a target correlation, Sklar’s theorem by hand, and three copulas at one tau.

Aug 1, 2026
Stream networks and tail-up covariance
R
spatial
GLS
freshwater
ecology tutorial

Stream distance is not Euclidean distance. Build a dendritic network in R, watch the Gaussian covariance fail, and fit a tail-up model and kriging by hand.

Aug 1, 2026
Checking your data against the design
R
data cleaning
survey design
monitoring
ecology tutorial

Five diagnostics in R that test an ecological dataset against the design it came from: the sampling frame, the protocol, the measurement grid and the labels.

Aug 1, 2026
Baseline selection and the return to the mean
R
experimental design
causal inference
monitoring
ecology tutorial

Targeting the worst sites manufactures a treatment effect. How large it gets, why parallel-trends diagnostics never fire, and which baseline design removes it.

Aug 1, 2026
Effect sizes from incomplete reports
R
meta-analysis
effect size
ecology tutorial

Papers print a median and quartiles, not a standard deviation. Measuring what recovered SDs cost an ecological meta-analysis: weights, coverage, bias.

Aug 1, 2026
Digit preference and heaping in field data
R
measurement
data cleaning
monitoring
ecology tutorial

Recorders drift towards round numbers and the mean drifts with them. Measuring digit heaping in R: the Whipple index, the bias it hides, and a mixture repair.

Jul 31, 2026
Rounded and coarsened measurements
R
measurement
data cleaning
ecology tutorial

Field data arrive on a grid. Measure the variance rounding adds, apply Sheppard’s correction, and fit the interval-censored likelihood to sward heights in R.

Jul 31, 2026
How long a calibration overlap do you need?
R
monitoring
survey design
time series
ecology tutorial

A monitoring scheme is about to change method. Measuring how many years of dual running buy back the trend, and when a free era indicator is the better spend.

Jul 31, 2026
Splicing a monitoring series
R
monitoring
time series
trend
ecology tutorial

A method change part-way through a monitoring series manufactures a trend. Measuring the bias, the exchange rate per decade, and why no diagnostic fires.

Jul 31, 2026
Non-response and site substitution
R
survey design
monitoring
sampling
ecology tutorial

A crew draws forty forest plots and reaches thirty-two. Measuring in R what nearest-plot substitution does to survey bias, variance and interval coverage.

Jul 31, 2026
The price of harmonising a species list
R
monitoring
data cleaning
ecology tutorial

Pushing two decades of records onto one taxonomic backbone destroys information. Measuring the cost: hidden trends, lost richness and a silent trait join.

Jul 31, 2026
Taxonomic revision and species trends
R
monitoring
data cleaning
ecology tutorial

A long monitoring series records names, not species. Simulate a split and a lump in R, measure the false richness trend, and price the two available repairs.

Jul 31, 2026
Interference between experimental plots
R
causal inference
experimental design
ecology tutorial

When treatment leaks between plots the estimated contrast shrinks while the standard error does not. A simulation measures the bias, the buffer cost and a fix.

Jul 30, 2026
Non-compliance in field experiments
R
causal inference
experimental design
ecology tutorial

Assigned treatment is not received treatment. A simulated fencing trial measures what intention-to-treat, per-protocol and the Wald ratio each estimate.

Jul 30, 2026
Variational inference from scratch
R
variational inference
Bayesian statistics
MCMC
ecology tutorial

Approximate an ecological posterior by optimisation in base R: coordinate ascent, the ELBO, and how much uncertainty mean-field inference throws away.

Jul 30, 2026
The variogram and the GP kernel
R
spatial
geostatistics
Bayesian statistics
ecology tutorial

The geostatistical variogram and the Gaussian process kernel are one object in two notations. The dictionary, a numerical check, and where the estimators part.

Jul 30, 2026
Comparing two ordinations with Procrustes
R
ordination
multivariate
vegan
ecology tutorial

Two ordinations of the same sites can look different for no ecological reason. Procrustes rotation and a hand-written PROTEST test, calibrated in base R.

Jul 30, 2026
Split-plot designs in ecology
R
experimental design
ANOVA
GLMM
ecology tutorial

A whole-plot treatment and a subplot treatment need two error strata. A simulation measures what one pooled error term costs each of them, in both directions.

Jul 30, 2026
When decision makers disagree
R
decision analysis
ecology tutorial

Aggregating stakeholder preferences in R: four pooling rules on one conservation table, how often they disagree, and what a rule-free choice really costs.

Jul 30, 2026
Eliciting probabilities from experts
R
decision analysis
Bayesian statistics
ecology tutorial

Simulate expert elicitation in R: the four-point question, overconfidence against nominal coverage, linear and logarithmic pooling, and Cooke weights.

Jul 29, 2026
Checking a mixture model
R
mixture models
model checking
ecology tutorial

Four measured checks on a fitted finite mixture in R: multiple optima, classification versus parameter uncertainty, the unbounded likelihood and predictive fit.

Jul 29, 2026
When a mixture is really skewness
R
mixture models
model checking
ecology tutorial

Fit a two-component normal mixture to skewed ecological size data and BIC prefers it: measure how often that happens, what tells the two apart, and the cost.

Jul 29, 2026
How many components in a mixture?
R
mixture models
model selection
ecology tutorial

Choosing the number of components in a mixture model in R: why the likelihood ratio test fails, and what the bootstrap, BIC and ICL each recover instead.

Jul 29, 2026
Fitting a mixture of normals in R
R
mixture models
EM
ecology tutorial

Separate fish age classes in a length-frequency sample with a finite mixture of normals: the EM algorithm written by hand in base R, and where it breaks down.

Jul 29, 2026
Checking a Bayesian computation
R
MCMC
Bayesian statistics
model checking
ecology tutorial

Four measured checks on an MCMC run in R: an exact benchmark, simulation-based calibration, divergences with the energy diagnostic, and Monte Carlo error.

Jul 29, 2026
Reparameterisation and Neal’s funnel
R
MCMC
Bayesian statistics
hierarchical models
ecology tutorial

Why hierarchical ecological models warn in Stan: measure the centred parameterisation failing on Neal’s funnel, fix it, and find where centred wins again.

Jul 29, 2026
The Laplace approximation in R
R
MCMC
Bayesian statistics
model selection
ecology tutorial

Fit a Gaussian at the posterior mode in base R: marginal likelihoods, where the approximation is excellent, and the three ways it fails in ecological models.

Jul 28, 2026
Hamiltonian Monte Carlo from scratch
R
MCMC
Bayesian statistics
ecology tutorial

Build Hamiltonian Monte Carlo in base R: leapfrog integration, energy error, and a measured comparison with random-walk Metropolis on a collinear posterior.

Jul 28, 2026
Checking a stochastic simulation
R
stochastic simulation
model checking
ecology tutorial

Four measured checks on a stochastic ecological simulation in R: replicate count, sampler validation, survivorship bias in the output, and seed handling.

Jul 28, 2026
Mean time to extinction, exactly
R
stochastic simulation
population models
extinction
ecology tutorial

An exact double sum gives the mean time to extinction of a birth-death population in base R, checked against Gillespie simulation and diffusion theory.

Jul 28, 2026
Tau leaping and the cost of a bigger step
R
stochastic simulation
population models
ecology tutorial

Tau leaping in base R: measuring what a larger simulation step costs in the mean, the variance and the whole distribution of an ecological birth-death model.

Jul 28, 2026
The Gillespie algorithm from scratch
R
stochastic simulation
population models
ecology tutorial

Build the exact Gillespie stochastic simulation algorithm in base R, validate it against a Poisson stationary distribution, and measure what exactness costs.

Jul 28, 2026
Checking a repeatability analysis
R
behaviour
repeatability
model checking
ecology tutorial

Four measured checks on a behavioural repeatability estimate in R: design efficiency, the gap between repeats, observer confounding, and the zero boundary.

Jul 28, 2026
Behaviour sequences as Markov chains
R
behaviour
Markov chains
ecology tutorial

Fit a Markov chain to an ethogram in base R: transition matrices from event and time-sampled records, tests for memory, time budgets and the pooling trap.

Jul 27, 2026
Behavioural syndromes in R
R
behaviour
mixed models
repeatability
ecology tutorial

Fit a bivariate mixed model by hand in base R to separate a behavioural syndrome from the within-individual correlation in repeated ecological field data.

Jul 27, 2026
Adjusted repeatability in R
R
behaviour
mixed models
repeatability
ecology tutorial

Repeatability shifts meaning once a model carries fixed effects. Hand-coded REML in R separates the raw, adjusted and enhanced versions and measures the gap.

Jul 27, 2026
Checking an animal model
R
quantitative genetics
heritability
model checking
ecology tutorial

Four measured checks on a fitted animal model in R: pedigree errors, the fixed-effect denominator, evolvability, and the boundary at zero in wild populations.

Jul 27, 2026
Maternal effects inflate heritability
R
quantitative genetics
heritability
study design
ecology tutorial

A base R simulation of how a shared nest inflates heritability in an animal model, why full sibs alone cannot separate the two, and what cross-fostering buys.

Jul 27, 2026
Pedigree structure and heritability precision
R
quantitative genetics
heritability
study design
ecology tutorial

Four simulated pedigrees holding the same 480 phenotyped animals give very different heritability precision, and counting related pairs ranks them backwards.

Jul 27, 2026
The animal model in R
R
quantitative genetics
heritability
mixed models
ecology tutorial

Estimate additive genetic variance and narrow-sense heritability from a pedigree in base R: build the relationship matrix, fit REML, predict breeding values.

Jul 27, 2026
Checking a range shift analysis
R
climate change
model checking
ecology tutorial
ggplot2

Four checks on a range shift analysis in R: resurvey effort, the null distribution of a shift, elevation against latitude, and what a rising CTI hides.

Jul 26, 2026
Range shifts and the climate lag
R
climate change
macroecology
ecology tutorial
ggplot2

Measure what an elevational range shift estimate contains: four ways to define an edge, the bias each carries, and what that leaves of the climatic debt.

Jul 26, 2026
Climate velocity in R
R
climate change
spatial
ecology tutorial
ggplot2

Compute climate velocity from the arithmetic up in base R, and measure how much of a velocity map is terrain, how unstable its mean is and how grain moves it.

Jul 26, 2026
Checking a decomposition analysis
R
decomposition
model checking
ecology tutorial
ggplot2

Four checks on a litterbag decomposition analysis in R: bags nested in plots, comparing k between treatments, the fixed intercept, and extrapolated numbers.

Jul 26, 2026
Mass loss and the carbon budget
R
decomposition
carbon
ecology tutorial
ggplot2

Litterbag mass loss is not carbon loss: measure in R the carbon concentration drift, soil contamination and mesh corrections hidden inside a decay constant.

Jul 26, 2026
The recalcitrant pool and the asymptote
R
decomposition
nonlinear regression
ecology tutorial
ggplot2

Two-pool and asymptotic decay models fit the same litterbag data and disagree about the limit value: likelihood profiles, AIC power and harvest design in R.

Jul 26, 2026
Fitting litter decomposition curves
R
decomposition
nonlinear regression
ecology tutorial
ggplot2

Fit Olson’s exponential to litterbag data in R and measure how far the decay constant k moves with the assumed error model and the length of the study.

Jul 26, 2026
Checking a macroecological pattern
R
macroecology
model checking
ecology tutorial
ggplot2

Four checks on a macroecological pattern in R: the shared record set, a random placement null, non-independent species, and slopes that move with grain.

Jul 25, 2026
Range size distributions
R
macroecology
biogeography
ecology tutorial
ggplot2

Measure geographic range sizes in a simulated atlas and see how grid grain, recording effort and the choice between AOO and EOO reshape the small-range tail.

Jul 25, 2026
The abundance-occupancy relationship
R
macroecology
occupancy
ecology tutorial
ggplot2

Occupancy is a censored count, so much of the abundance-occupancy relationship is arithmetic: simulate it in R and measure what its scatter really records.

Jul 25, 2026
Text and regular expressions in R
R
data cleaning
ecology tutorial
ggplot2

Pull site codes and sward heights out of free-text field notes with base R regular expressions, and measure what each pattern gets right and what it gets wrong.

Jul 25, 2026
Dates and times in ecological data
R
data cleaning
ecology tutorial
ggplot2

Parsing field dates in base R: where as.Date returns a silent NA, what a swapped day and month does to a flight period, and how summer time bends activity data.

Jul 25, 2026
Git for ecologists
R
reproducibility
ecology tutorial
ggplot2

A twelve step editing history and eight manuscript figures: measure how many come back given the code state, the data version and the seed that produced them.

Jul 25, 2026
Turning your code into an R package
R
reproducibility
ecology tutorial
ggplot2

Three ecological analyses copied the same R helper and it drifted. Measure what that costs the reported result, then build the minimal package that prevents it.

Jul 24, 2026
Building an analysis pipeline with targets
R
reproducibility
ecology tutorial
ggplot2

Build a dependency graph in base R for a stream monitoring analysis, then measure what one stale intermediate does to the reported ecological interval.

Jul 24, 2026
Pinning package versions with renv
R
reproducibility
ecology tutorial
ggplot2

Build a lockfile by hand in base R, then measure what a quiet package update does to a reported ecological result: one tie-break rule, two different answers.

Jul 24, 2026
Checking an analysis script
R
reproducibility
model diagnostics
ecology tutorial
ggplot2

Four checks on an R analysis script for ecologists: a clean session run, repeatability under seeds, row order dependence, and reported numbers against output.

Jul 24, 2026
Speeding up your analysis code
R
reproducibility
ecology tutorial
ggplot2

Measure before you optimise: which R rewrites buy a constant factor, which change the algorithm, and what the time you save buys an ecological analysis.

Jul 24, 2026
Debugging and defensive R code
R
reproducibility
ecology tutorial
ggplot2

The expensive R error is the one that runs and returns a wrong number. Measured on a beetle survey: what stays silent, what it costs, and what catches it.

Jul 24, 2026
Testing your analysis code
R
reproducibility
ecology tutorial
ggplot2

Write a test runner in base R, then measure it: which kinds of test catch the small coding errors that quietly change an ecological result, and which miss them.

Jul 24, 2026
Checking a figure
R
data visualisation
ggplot2
ecology tutorial

Four measured checks on an ecological figure in R: a truncated axis, a title too wide for the canvas, colour vision loss, and a title that reads as a claim.

Jul 23, 2026
Effect plots that show the data
R
data visualisation
ggplot2
ecology tutorial

Bar charts hide the distribution, and a partial effect is not a marginal effect. Measuring what an ecological effect plot in R shows and what it quietly hides.

Jul 23, 2026
Designing an ordination figure
R
data visualisation
ggplot2
ecology tutorial

An ordination figure draws distances, so panel shape and axis scaling change what your community map says. Measured in base R with stress, hulls and ellipses.

Jul 23, 2026
Choosing colours for ecological data
R
data visualisation
ggplot2
ecology tutorial

Sequential, diverging or qualitative is a question about the data, not about taste. Measured in R: the reading errors each palette choice puts into a figure.

Jul 23, 2026
Checking an unstructured-data analysis
R
citizen science
monitoring
ecology tutorial
ggplot2

Four checks on a trend built from opportunistic records in R: effort in space and time, reporting bias between species, first records, and external validation.

Jul 23, 2026
Occupancy from unstructured records
R
citizen science
monitoring
ecology tutorial
ggplot2

Turn opportunistic species records into repeat visits, fit an occupancy model in R by hand, and measure how much the definition of a visit moves the estimate.

Jul 23, 2026
Reporting rates and effort drift
R
citizen science
monitoring
ecology tutorial
ggplot2

Recorder effort drifts over twenty years of casual species records. Measure the false trend it invents in a reporting rate, and which drifts a correction sees.

Jul 22, 2026
List-length analysis for opportunistic data
R
citizen science
monitoring
ecology tutorial
ggplot2

Opportunistic species records carry the observer as well as the species. This R tutorial conditions a trend on list length and measures what is left over.

Jul 22, 2026
Checking a dose-response analysis
R
ecotoxicology
GLM
ecology tutorial
ggplot2

Five checks on an ecotoxicology dose-response fit in R: control mortality, vessel overdispersion, tail extrapolation, nominal dose, and the two-stressor null.

Jul 22, 2026
Hormesis and non-monotonic responses
R
ecotoxicology
nonlinear regression
ecology tutorial
ggplot2

Fit a hormetic dose-response curve in R, measure how a monotonic model shifts the ED10, and see what a test for low-dose stimulation in ecotoxicology detects.

Jul 22, 2026
Confidence intervals for effective doses
R
ecotoxicology
GLM
ecology tutorial
ggplot2

Delta, Fieller and profile intervals for the LC50 and LC10 in R, with measured coverage, and why the concentration layout matters more than the animal count.

Jul 22, 2026
Dose-response curves and the LC50
R
ecotoxicology
GLM
ecology tutorial
ggplot2

Fit a dose-response curve in R with three binomial links: the LC50 barely moves, the LC10 moves, and AIC spots the asymmetric link but not probit against logit.

Jul 22, 2026
Checking an invasion spread model
R
invasion ecology
dispersal
ecology tutorial
ggplot2

Four checks on an invasion spread model in R: the density threshold, the lag phase, the detection delay, and the Allee effect that stops a spreading wave.

Jul 22, 2026
Long-distance jumps and stratified spread
R
invasion ecology
dispersal
ecology tutorial
ggplot2

Rare long jumps found new foci ahead of an invasion front. Simulate stratified spread in R and measure the speed, the prediction variance and the payoff.

Jul 21, 2026
Fat tails and accelerating spread
R
invasion ecology
dispersal
ecology tutorial
ggplot2

An invasion front with a fat-tailed dispersal kernel never settles at a constant speed. Simulating and measuring accelerating spread in R with ggplot2.

Jul 21, 2026
The speed of an invasion front
R
invasion ecology
dispersal
ecology tutorial
ggplot2

Step a spreading population forward in R with an integrodifference model, measure the speed of the invasion front, and check it against the closed form.

Jul 21, 2026
Checking a sequential decision model
R
conservation
decision analysis
ecology tutorial
ggplot2

Four checks on a sequential conservation decision in R: the discount rate, the state grid, the assumed transition matrix and the end of the planning horizon.

Jul 21, 2026
When to stop monitoring
R
monitoring
decision analysis
ecology tutorial
ggplot2

Monitoring has a stopping rule. Backward induction in R prices a further year of survey against the cost of delay, and what waiting for a p-value costs.

Jul 21, 2026
Stochastic dynamic programming for harvest
R
conservation
decision analysis
ecology tutorial
ggplot2

Derive an optimal harvest rule in R by stochastic dynamic programming, then measure what recruitment noise does to it and what a concave payoff does to it.

Jul 21, 2026
Markov decision processes for management
R
conservation
decision analysis
ecology tutorial
ggplot2

Build a Markov decision process for an invasive plant in R, solve it by value iteration, and measure what a one year view of the same problem costs a reserve.

Jul 21, 2026
Checking a decision analysis
R
conservation
decision analysis
model diagnostics
ecology tutorial
ggplot2

Four checks on a conservation decision analysis in R: weight and table sensitivity, the value of information, the alternative set, and the attitude to risk.

Jul 20, 2026
Adaptive management and learning
R
conservation
decision analysis
ecology tutorial
ggplot2

Two hypotheses about harvest mortality in a hunted population, Bayesian model weights updated each year, and the horizon at which active management pays off.

Jul 20, 2026
The expected value of information
R
conservation
decision analysis
ecology tutorial
ggplot2

Compute the expected value of perfect, partial and sample information by hand in R for a conservation decision, and measure when uncertainty is worth nothing.

Jul 20, 2026
Structured decision making in R
R
conservation
decision analysis
ecology tutorial
ggplot2

Build a conservation consequence table in R, screen out dominated options, and measure how much of the final ranking is ecology and how much is bookkeeping.

Jul 20, 2026
Checking a reintroduction analysis
R
conservation
reintroduction
PVA
model diagnostics
ecology tutorial
ggplot2

Four checks on a stage structured population viability projection in R: the horizon, the variance budget, correlated vital rates and density dependence.

Jul 20, 2026
Restoration trajectories and recovery
R
conservation
restoration
community ecology
ecology tutorial
ggplot2

Measure how far a restored site has recovered in R: metric choice, chronosequence bias, a drifting reference and the trouble with extrapolating an asymptote.

Jul 20, 2026
SLOSS and reserve configuration
R
conservation
reserve design
biodiversity
ecology tutorial
ggplot2

Single large or several small? Simulate reserve configurations in R and measure the two properties that decide it: beta diversity and environmental correlation.

Jul 19, 2026
Reintroduction release strategies
R
conservation
reintroduction
PVA
population dynamics
ecology tutorial
ggplot2

Release size, schedule and stage composition compared in R against a stochastic Lefkovitch model, with post-release mortality and a measured stopping rule.

Jul 19, 2026
Checking a climate window analysis
R
climate
phenology
model diagnostics
ecology tutorial
ggplot2

Four checks for a climate window analysis in R: shared trends, the choice between weather variables, held-out years, and what the search grid alone is worth.

Jul 19, 2026
Climate window analysis in R
R
climate
phenology
hypothesis testing
ecology tutorial
ggplot2

Slide every candidate weather window past a yearly ecological response in R, measure how often the naive best window is significant, and correct it properly.

Jul 19, 2026
Drought indices for ecologists
R
climate
drought
phenology
ecology tutorial
ggplot2

Build SPI, SPEI and a climatic water balance by hand in R, and measure how much the accumulation window, baseline and evapotranspiration decide a drought year.

Jul 19, 2026
Degree days and thermal time in R
R
phenology
climate
thermal ecology
ecology tutorial
ggplot2

Build degree day models in R, compare the average, triangle and sine methods, estimate a base temperature from data, and measure what each choice costs.

Jul 19, 2026
Checking an epidemic estimate
R
epidemiology
disease ecology
model diagnostics
ecology tutorial
ggplot2

Four checks for an epidemic reproduction number in R: reporting delay, under-reporting, weekly aggregation and an assumption sweep priced against the interval.

Jul 19, 2026
Seasonality and recurrent epidemics
R
epidemiology
disease ecology
population dynamics
ecology tutorial
ggplot2

An SIR model with host turnover in R: measure the intrinsic epidemic period, the seasonal forcing that turns annual cycles biennial, and stochastic fadeout.

Jul 18, 2026
Estimating R0 from incidence data
R
epidemiology
disease ecology
GLM
ecology tutorial
ggplot2

Estimate the reproduction number from an epidemic curve in R: Poisson growth rates by hand, the generation interval map, and a renewal equation Rt estimate.

Jul 18, 2026
The SEIR model and the latent period
R
epidemiology
disease ecology
SEIR
population dynamics
ecology tutorial
ggplot2

Add an exposed class to the SIR model in R, integrate it with a hand written RK4 solver, and measure how a latent period biases the reproduction number.

Jul 18, 2026
Checking an isotopic niche analysis
R
stable isotopes
trophic ecology
model diagnostics
ecology tutorial
ggplot2

Four checks for an isotopic niche analysis in R: sample size and power, the C:N lipid correction, a pipeline sweep, and tissue turnover in trophic ecology.

Jul 18, 2026
Isotopic niche overlap between groups
R
stable isotopes
trophic ecology
niche overlap
ecology tutorial
ggplot2

Code ellipse overlap for isotopic niches in R and measure how the headline percentage moves with the denominator, the containment probability and sample size.

Jul 18, 2026
Trophic position from stable isotopes
R
stable isotopes
trophic ecology
food webs
ecology tutorial
ggplot2

Estimate trophic position from nitrogen isotopes in R, and measure how much of a consumer’s place in the food web rests on the assumed enrichment factor.

Jul 18, 2026
Isotopic niche width: hulls and ellipses
R
stable isotopes
trophic ecology
ecology tutorial
ggplot2

Measure isotopic niche width in R with Layman convex hulls and standard ellipses, and see why hull area follows sample size while corrected SEAc does not.

Jul 18, 2026
Checking a stock assessment
R
fisheries
stock assessment
model diagnostics
ecology tutorial
ggplot2

Four checks for a fishery stock assessment in R: retrospective peels and Mohn’s rho, index contrast, an assumption sweep, and a closed-loop harvest rule test.

Jul 17, 2026
Standardising catch per unit effort
R
fisheries
stock assessment
GLM
ecology tutorial
ggplot2

Standardise fishery catch per unit effort in R with a GLM built by hand, then measure how hyperstability still hides a collapsing stock from the index.

Jul 17, 2026
Stock-recruitment and reference points
R
fisheries
stock assessment
population dynamics
ecology tutorial
ggplot2

Beverton-Holt and Ricker curves in steepness form, per-recruit fishery reference points in base R, and how much of Fmsy is data and how much is assumption.

Jul 17, 2026
Surplus production models in R
R
fisheries
stock assessment
population dynamics
ecology tutorial
ggplot2

Fit a Schaefer biomass dynamics model to a catch series and an abundance index in R, and measure why a one-way trip leaves r, K and MSY badly identified.

Jul 17, 2026
Checking a metabarcoding analysis
R
metabarcoding
diet analysis
model diagnostics
ecology tutorial
ggplot2

Four diagnostics for a DNA metabarcoding diet study in R: rarefying against the alternatives, the compositional trap, nested PCR replicates and read depth.

Jul 17, 2026
Contamination filtering in metabarcoding
R
metabarcoding
diet analysis
model diagnostics
ecology tutorial
ggplot2

Filtering a DNA metabarcoding read table in R: cross-contamination, reagent DNA and index hopping scored against four filtering rules with a known truth.

Jul 17, 2026
PCR bias and amplification efficiency
R
metabarcoding
diet analysis
compositional data
ecology tutorial
ggplot2

Simulating taxon-specific PCR efficiency in R: why metabarcoding bias is linear in the log-ratio, what a mock community corrects, and where the mock fails.

Jul 17, 2026
Metabarcoding reads as compositional data
R
metabarcoding
diet analysis
compositional data
ecology tutorial
ggplot2

A simulated diet study in R showing why DNA metabarcoding read counts are compositional, and how relative read abundance and occurrence summaries fail.

Jul 16, 2026
Checking a presence-only model
R
MaxEnt
species distributions
presence-only
model diagnostics
ecology tutorial
ggplot2

Four diagnostics for a presence-only species distribution model in R: novel environments and clamping, the four MaxEnt outputs, the AUC ceiling and splits.

Jul 16, 2026
Sampling bias in presence-only models
R
MaxEnt
species distributions
presence-only
sampling bias
ecology tutorial
ggplot2

Survey effort thins presence-only records: measuring how much sampling bias an effort covariate, target-group background and spatial thinning remove in R.

Jul 16, 2026
Regularisation and features in MaxEnt
R
MaxEnt
species distributions
regularisation
presence-only
ecology tutorial
ggplot2

How the MaxEnt feature classes and the regularisation multiplier work, built by hand in R, and what each setting does to a fitted species response curve.

Jul 16, 2026
MaxEnt as a Poisson point process
R
MaxEnt
species distributions
point process
presence-only
ecology tutorial
ggplot2

MaxEnt, a Poisson point process, a count GLM and weighted logistic regression fitted to the same presence-only records in R, and measured to be one model.

Jul 16, 2026
Choosing a decision threshold from costs
R
machine learning
model evaluation
conservation
ecology tutorial
ggplot2

Choosing a decision threshold in R: the cost ratio hidden in every ecological cut-off, decision curves and net benefit, and the price of miscalibration.

Jul 16, 2026
Data leakage in ecological model validation
R
machine learning
model evaluation
model diagnostics
ecology tutorial
ggplot2

Four routes by which information crosses from a held-out fold into an ecological model fit, each measured in R: preprocessing, screening, grouped sites, tuning.

Jul 16, 2026
Calibrating predicted probabilities in R
R
machine learning
model evaluation
forecasting
ecology tutorial
ggplot2

Reliability diagrams, the Brier decomposition, Platt scaling and isotonic regression in base R for occupancy models whose probabilities cannot be trusted.

Jul 15, 2026
Class imbalance in species presence models
R
machine learning
model evaluation
species distributions
ecology tutorial
ggplot2

What class imbalance does to a species presence model in R: why the positive count and not the ratio limits the fit, and what downsampling really changes.

Jul 15, 2026
Checking an acoustic monitoring analysis
R
bioacoustics
acoustic monitoring
model diagnostics
ecology tutorial
ggplot2

Four diagnostics for automated acoustic monitoring in R: bout overdispersion, thresholds that fail to transfer between sites, duty cycles and validation effort.

Jul 15, 2026
Call rates and density from acoustic surveys
R
bioacoustics
acoustic monitoring
abundance
imperfect detection
ecology tutorial
ggplot2

Cue counting in base R: turn acoustic detection rates into density, and measure which part of the variance dominates and which bias passes through undamped.

Jul 15, 2026
Score thresholds and precision in bioacoustics
R
bioacoustics
acoustic monitoring
model evaluation
ROC
ecology tutorial
ggplot2

Choosing a score threshold for an acoustic recogniser in R: why AUC ignores prevalence, why precision collapses at a quiet site, and how to validate clips.

Jul 15, 2026
Automated acoustic detections as data
R
bioacoustics
acoustic monitoring
imperfect detection
ecology tutorial
ggplot2

Simulating an acoustic recogniser in base R to show why automated detection counts are an affine index of true call rate, with a false-trigger floor underneath.

Jul 15, 2026
Checking a genetic clustering analysis
R
population genetics
model diagnostics
ecology tutorial
ggplot2

Four checks for a genetic clustering analysis in R: unbalanced sampling, linked loci, variation between runs, and whether the structure survives a subsample.

Jul 14, 2026
Assignment tests and self-assignment
R
population genetics
ecology tutorial
ggplot2

Build genotype assignment likelihoods in base R, measure the leave-one-out bias in self-assignment, and run an exclusion test for an unsampled source.

Jul 14, 2026
Choosing K in genetic clustering
R
population genetics
model selection
ecology tutorial
ggplot2

Implement the log-likelihood curve, cross-validation and the Evanno delta K in R, then watch all three choose clusters in a cline of demes that has none.

Jul 14, 2026
Admixture and ancestry proportions in R
R
population genetics
clustering
ecology tutorial
ggplot2

Build the STRUCTURE model in R, fit ancestry proportions by EM, and measure how many loci and how much differentiation an honest admixture bar plot needs.

Jul 14, 2026
Checking an eDNA occupancy analysis
R
eDNA
occupancy
model diagnostics
ecology tutorial
ggplot2

Four checks for a three-level eDNA occupancy model in R: detection heterogeneity, predictive checks, transported DNA, and pinning the contamination rate.

Jul 14, 2026
Sampling design for eDNA surveys
R
eDNA
occupancy
survey design
ecology tutorial
ggplot2

Split an eDNA budget between sites, water samples and PCR replicates in R, with exact asymptotic precision for occupancy and a measured optimal design.

Jul 14, 2026
False positives in eDNA surveys
R
eDNA
occupancy
imperfect detection
ecology tutorial
ggplot2

A contaminated PCR replicate looks exactly like a rare detection. Fit the false-positive mixture for eDNA occupancy in R and measure what field blanks buy.

Jul 14, 2026
Three-level occupancy models for eDNA
R
eDNA
occupancy
imperfect detection
ecology tutorial
ggplot2

An eDNA survey can miss a species at three levels. Fit site occupancy, sample availability and PCR detection by hand in R, and see what pooling them costs.

Jul 13, 2026
Checking a conservation prioritisation
R
conservation planning
model diagnostics
ecology tutorial
ggplot2

Four checks for a reserve selection plan in R: the gap between greedy and the exact optimum, run to run spread, data error, and how the target decides.

Jul 13, 2026
Compactness in reserve design
R
conservation planning
optimisation
ecology tutorial
ggplot2

Add a boundary length penalty to a reserve selection problem in R, anneal it by hand, and measure what spatial cohesion really costs in conservation budget.

Jul 13, 2026
Conservation costs and return on investment
R
conservation planning
biodiversity
ecology tutorial
ggplot2

Reserve selection with a land price surface in R: three greedy rules under a fixed budget, and the gain from maximising species represented per pound spent.

Jul 13, 2026
Complementarity and reserve selection
R
conservation planning
biodiversity
ecology tutorial
ggplot2

Compare hotspot and greedy complementarity reserve selection in base R, and measure how many planning units each rule needs to represent every species.

Jul 13, 2026
Checking a landscape genetics analysis
R
landscape genetics
model diagnostics
ecology tutorial
ggplot2

Four checks for a landscape genetics study in R: count the independent units, tell barrier from distance, time the lag after fragmentation, price the markers.

Jul 13, 2026
Optimising a resistance surface
R
landscape genetics
model selection
ecology tutorial
ggplot2

Search land-cover resistance values against genetic distance in R, then measure how much optimised r squared a deliberately meaningless map already buys.

Jul 12, 2026
Multiple matrix regression with MMRR
R
landscape genetics
hypothesis testing
ecology tutorial
ggplot2

Regress a genetic distance matrix on several landscape distances in base R, permute rows and columns together, and measure the type I error each test has.

Jul 12, 2026
Isolation by distance and by resistance
R
landscape genetics
population genetics
ecology tutorial
ggplot2

Regress simulated genetic differentiation on Euclidean, least-cost and resistance distance in R, and see which of the three a barrier to gene flow shows up in.

Jul 12, 2026
Checking a connectivity analysis
R
landscape ecology
GIS
model diagnostics
ecology tutorial
ggplot2

Four checks for a resistance-surface analysis in R: calibrate the metric, test what it predicts, vary the transform, and change the grain before believing it.

Jul 12, 2026
Circuit theory and effective resistance
R
landscape ecology
GIS
ecology tutorial
ggplot2

Solve a landscape as an electrical circuit in base R, map current density, and measure the thing least-cost paths cannot see: whether a redundant route exists.

Jul 12, 2026
Least-cost paths and resistance surfaces
R
landscape ecology
GIS
ecology tutorial
ggplot2

Compute cost distance and least-cost paths in base R with iterative sweeps, then measure how much the answer depends on the resistance values you chose.

Jul 12, 2026
Patch metrics and fragmentation in R
R
landscape ecology
GIS
ecology tutorial
ggplot2

Label habitat patches with base R, measure fragmentation at a fixed habitat amount, and watch the percolation threshold and the grain change the answer.

Jul 12, 2026
Checking a coalescent analysis
R
population genetics
model diagnostics
ecology tutorial
ggplot2

Four checks for coalescent inference in R: what one locus can say, what recombination buys, whether demography mimics selection, and where to spend effort.

Jul 11, 2026
Tajima’s D and the frequency spectrum
R
population genetics
ecology tutorial
ggplot2

Build Tajima’s D from the site frequency spectrum in R and measure what it detects: growth, structure and bottlenecks all move it, and so does selection.

Jul 11, 2026
Nucleotide diversity and Watterson theta
R
population genetics
ecology tutorial
ggplot2

Put mutations on coalescent trees in R, compare the two classical estimators of theta, and measure why many short loci beat one long sequence of the same size.

Jul 11, 2026
The coalescent and gene trees
R
population genetics
ecology tutorial
ggplot2

Simulate the coalescent in R, check the tree height and total branch length against theory, and see why a single gene tree says almost nothing about history.

Jul 11, 2026
Checking an effective size estimate
R
population genetics
model diagnostics
ecology tutorial
ggplot2

Four checks for an Ne estimate in R: which time window it covers, what sampling relatives does to it, how wide the interval is, and what linkage costs.

Jul 11, 2026
Bottlenecks and genetic diversity
R
population genetics
ecology tutorial
ggplot2

Push a simulated population through a bottleneck in R and watch which measures of diversity notice: allelic richness, heterozygosity and the M ratio disagree.

Jul 11, 2026
Estimating Ne from genetic data
R
population genetics
ecology tutorial
ggplot2

Implement the temporal and linkage disequilibrium estimators of effective size in R, and measure how much data each needs before its answer means anything.

Jul 10, 2026
Effective population size in R
R
population genetics
ecology tutorial
ggplot2

Simulate what Ne means in R: the sex ratio, the variance in offspring number and the harmonic mean across bad years, each measured against its formula.

Jul 10, 2026
Checking a population genetics analysis
R
population genetics
model diagnostics
ecology tutorial
ggplot2

Four checks for an Fst analysis in R: loci against individuals, separating substructure from marker error, filtering rare variants, and outlier tests.

Jul 10, 2026
Drift, migration and isolation by distance
R
population genetics
ecology tutorial
ggplot2

Simulate drift and gene flow in R, check the Fst equilibrium against 1/(1 + 4Nm), and see how little a measured Fst says about the number of migrants.

Jul 10, 2026
F-statistics and population structure
R
population genetics
ecology tutorial
ggplot2

Compute Fis, Fst and Fit in R from three heterozygosities, see why Gst is capped by diversity within populations, and estimate Fst without the sampling bias.

Jul 10, 2026
Hardy-Weinberg expectations in R
R
population genetics
ecology tutorial
ggplot2

Test Hardy-Weinberg proportions in R with a chi-square and an exact test, and see why a heterozygote deficit is weak evidence of inbreeding in a real sample.

Jul 10, 2026
Checking a finite population model
evolutionary ecology
evolutionary game theory
model diagnostics
R
ecology tutorial

Diagnostics for finite population models in R: how many replicates a fixation probability needs, why weak selection scales with wN, and when branching is real.

Jul 10, 2026
Adaptive dynamics and evolutionary branching
evolutionary ecology
evolutionary game theory
population dynamics
R
ecology tutorial

Adaptive dynamics in R: invasion fitness for a Gaussian competition model, the selection gradient, pairwise invasibility plots and evolutionary branching.

Jul 9, 2026
Evolutionary games in finite populations
evolutionary ecology
evolutionary game theory
natural selection
R
ecology tutorial

Evolutionary game theory in a finite population with base R: frequency-dependent fitness, exact fixation probabilities, the one-third law and risk dominance.

Jul 9, 2026
The Moran process and fixation probability
evolutionary ecology
population dynamics
natural selection
R
ecology tutorial

Model selection in a finite population in base R: the Moran birth-death process, the exact fixation probability of a single mutant, and how long fixation takes.

Jul 9, 2026
Checking a spatial cooperation model
evolutionary ecology
evolutionary game theory
model diagnostics
spatial ecology
R
ecology tutorial

Four diagnostics for lattice models of cooperation in R: update timing, neighbourhood and boundary choices, seed replication, and whether the game matters.

Jul 9, 2026
Multilevel selection and group structure
evolutionary ecology
evolutionary game theory
R
ecology tutorial

Split the Price equation into between-group and within-group terms in R, and build a case where cooperators lose inside every group yet rise in the population.

Jul 9, 2026
Update rules and cooperation on graphs
evolutionary ecology
evolutionary game theory
spatial ecology
R
ecology tutorial

Implement the Ohtsuki and Nowak transform in R and recover the b/c > k rule: whether spatial structure favours cooperation depends on the replacement rule.

Jul 9, 2026
Network reciprocity on a lattice
evolutionary ecology
evolutionary game theory
spatial ecology
R
ecology tutorial

Simulate the spatial prisoner’s dilemma in base R: cooperator clusters survive on a lattice at benefit-to-cost ratios where a well-mixed population loses them.

Jul 8, 2026
Checking a reputation model
evolutionary ecology
evolutionary game theory
model diagnostics
R
ecology tutorial

Three diagnostics for indirect reciprocity models in R: sensitivity to the benefit-to-cost ratio, replication across seeds, and drift in a finite population.

Jul 8, 2026
Public and private reputation
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

An agent-based reputation model in R: when opinions are private rather than public, stern judging collapses, standing survives, and image scoring improves.

Jul 8, 2026
Assessment rules for reputation
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

Four assessment rules compared in R: image scoring, standing, stern judging and shunning, and why only rules excusing justified refusal keep cooperation going.

Jul 8, 2026
Indirect reciprocity and reputation
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

Indirect reciprocity in R: how reputation lets cooperation pay among strangers, the q > c/b threshold for helping, and the separatrix that splits the outcomes.

Jul 8, 2026
Checking a reciprocity model
evolutionary ecology
evolutionary game theory
model diagnostics
R
ecology tutorial

Three checks for a reciprocity model in R: errors that unravel tit-for-tat, sensitivity to the continuation probability, and the need for repeat partners.

Jul 8, 2026
Strategies in the iterated game
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

Evolutionary dynamics of iterated prisoner’s dilemma strategies in R: why cooperation and defection are both stable, and the start that decides which wins.

Jul 8, 2026
Direct reciprocity and tit-for-tat
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

How repeated interaction rescues cooperation in R: the shadow of the future, tit-for-tat, and the continuation probability at which reciprocity beats defection.

Jul 7, 2026
The prisoner’s dilemma in R
evolutionary ecology
evolutionary game theory
social evolution
R
ecology tutorial

The prisoner’s dilemma in R: why defection dominates a single encounter and mutual cooperation collapses, the starting point for the evolution of cooperation.

Jul 7, 2026
Checking a kin selection analysis
evolutionary ecology
social evolution
model diagnostics
R
ecology tutorial

Three ways Hamilton’s rule misleads in R: non-additive payoffs, the scale of competition among relatives, and benefits that never reach any kin at all.

Jul 7, 2026
Relatedness as a regression
evolutionary ecology
social evolution
quantitative genetics
R
ecology tutorial

What genetic relatedness really means in R: not a pedigree fraction but a regression of one genotype on another, and why the reference population matters.

Jul 7, 2026
Hamilton’s rule and kin selection
evolutionary ecology
social evolution
natural selection
R
ecology tutorial

Simulate kin selection in R: an altruism allele spreads only when relatedness times benefit exceeds cost, rb greater than c, the core of social evolution.

Jul 7, 2026
The Price equation in R
evolutionary ecology
social evolution
quantitative genetics
R
ecology tutorial

Decompose evolutionary change in R with the Price equation: selection as a covariance plus a transmission term, an exact identity that underlies kin selection.

Jul 7, 2026
Checking a game theory model
evolutionary ecology
evolutionary game theory
model diagnostics
R
ecology tutorial

Three checks for evolutionary game models in R: sensitivity to assumed payoffs, drift around an ESS in finite populations, and when the ESS is never reached.

Jul 6, 2026
Sex ratio evolution and the ESS
evolutionary ecology
evolutionary game theory
sex allocation
R
ecology tutorial

Why sex ratios are near 1:1 in R: Fisher’s frequency-dependent argument as an evolutionarily stable strategy, and the female bias under local mate competition.

Jul 6, 2026
The replicator equation in R
evolutionary ecology
evolutionary game theory
population dynamics
R
ecology tutorial

Simulate evolutionary game dynamics in base R with the replicator equation: convergence to an ESS, and the rock-paper-scissors cycles that never settle.

Jul 6, 2026
The hawk-dove game and the ESS
evolutionary ecology
evolutionary game theory
natural selection
R
ecology tutorial

Model animal conflict in R with the hawk-dove game: the mixed evolutionarily stable strategy, the invasion criterion, and replicator dynamics converging to it.

Jul 6, 2026
Checking a selection analysis
evolutionary ecology
quantitative genetics
natural selection
model diagnostics
R
ecology tutorial

Three diagnostics for selection gradients in R: collinearity among traits, non-normal fitness and the bootstrap, and reading the differential-gradient gap.

Jul 6, 2026
The multivariate breeder’s equation
evolutionary ecology
quantitative genetics
natural selection
R
ecology tutorial

Predict multi-trait evolution in R with the Lande equation delta z = G beta: correlated responses, genetic constraints, and the line of least resistance.

Jul 6, 2026
The breeder’s equation in R
evolutionary ecology
quantitative genetics
heritability
natural selection
R
ecology tutorial

Predict the response to selection in R with the breeder’s equation R = h squared S, estimate realised heritability, and see why it drifts over generations.

Jul 6, 2026
Selection differentials and gradients in R
evolutionary ecology
quantitative genetics
natural selection
R
ecology tutorial

Measure natural selection on correlated traits in R: the differential captures total selection, the gradient isolates direct selection by multiple regression.

Jul 5, 2026
Checking an epidemic model
ecology tutorial
R
disease ecology
model diagnostics
theoretical ecology

Three checks for disease models in R: density versus frequency-dependent transmission, estimating R0 from the growth rate, and why superspreading breaks mixing.

Jul 5, 2026
R0 and herd immunity
ecology tutorial
R
disease ecology
theoretical ecology
population models

The reproduction number in R: why an epidemic needs R0 above one, and why immunising a fraction one minus one over R0 of the population stops it spreading.

Jul 5, 2026
Host density and endemic disease
ecology tutorial
R
disease ecology
population models
theoretical ecology

Endemic disease in R: why density-dependent transmission gives a host-density threshold for invasion, and how a pathogen settles to an endemic prevalence.

Jul 5, 2026
The SIR epidemic model
ecology tutorial
R
disease ecology
population models
theoretical ecology

The SIR model in R: building an epidemic from susceptible, infected and recovered compartments, and why the reproduction number decides whether it spreads.

Jul 5, 2026
Checking for alternative stable states
ecology tutorial
R
community ecology
model diagnostics
theoretical ecology

Testing alternative stable states in R: why a bimodal distribution is not proof, why a driver mimics one, and how perturbation and hysteresis give the evidence.

Jul 5, 2026
Hysteresis and tipping points
ecology tutorial
R
theoretical ecology
population models
community ecology

Tipping points in R: how a slow driver pushes an ecosystem past a fold, why the collapse is sudden, and why simply reversing the driver does not reverse it.

Jul 4, 2026
Basins of attraction and the separatrix
ecology tutorial
R
community ecology
theoretical ecology
coexistence

Basins of attraction in R: which starting abundances lead to which stable state, the separatrix that divides them, and why unequal competitors differ.

Jul 4, 2026
Priority effects and alternative stable states
ecology tutorial
R
community ecology
coexistence
theoretical ecology

Priority effects in R: how strong mutual competition creates two alternative stable states, so the winner is set by arrival order, not competitive rank.

Jul 4, 2026
Checking a storage-effect analysis
ecology tutorial
R
community ecology
coexistence
model diagnostics

Three checks for the storage effect in R: is growth buffered, do species respond differently, and is variability alone being mistaken for coexistence.

Jul 4, 2026
Relative nonlinearity of competition
ecology tutorial
R
community ecology
coexistence
theoretical ecology

Relative nonlinearity in R: how curvature in a species’ response to a fluctuating limiting factor becomes a second fluctuation-dependent route to coexistence.

Jul 4, 2026
Partitioning the invasion growth rate
ecology tutorial
R
community ecology
coexistence
theoretical ecology

Invasion growth in R: testing coexistence in a fluctuating environment and splitting a rare species’ growth into a fluctuation-free part and the storage effect.

Jul 4, 2026
The storage effect and coexistence
ecology tutorial
R
community ecology
coexistence
biodiversity

The storage effect in R: how a fluctuating environment lets competitors coexist through the lottery model, buffered growth, and a rare-species advantage.

Jul 4, 2026
Checking a CNDD analysis
ecology tutorial
R
community ecology
model diagnostics
plant ecology

Three checks for conspecific density dependence in R: the habitat confound that hides it, whether rarer species truly show more, and enemies versus competition.

Jul 3, 2026
Rare-species advantage and coexistence
ecology tutorial
R
community ecology
coexistence
biodiversity

Negative frequency dependence in R: why conspecific density dependence gives every species an edge when rare, and how the invasion criterion yields coexistence.

Jul 3, 2026
Conspecific negative density dependence
ecology tutorial
R
community ecology
coexistence
plant ecology

Conspecific negative density dependence in R: measuring how seedlings survive worse among their own kind, and why that difference stabilises coexistence.

Jul 3, 2026
Janzen-Connell and tree diversity
ecology tutorial
R
community ecology
biodiversity
coexistence

The Janzen-Connell hypothesis in R: how specialised natural enemies near parent trees give rare species an edge and turn competitive exclusion into coexistence.

Jul 3, 2026
Checking an ideal free analysis
ecology tutorial
R
habitat selection
model diagnostics
behaviour

Three checks for an ideal free distribution study in R: is fitness really equalised, are competitors equal, and why the matching slope cannot name a mechanism.

Jul 3, 2026
Input matching and undermatching
ecology tutorial
R
foraging
behaviour
habitat selection

Testing the ideal free distribution in R: the matching slope, why real animals undermatch and under-use the best patches, and what that slope really reveals.

Jul 3, 2026
Density-dependent habitat selection
ecology tutorial
R
habitat selection
behaviour
population ecology

Density-dependent habitat selection and Morris’s isodar in R: how animals spill into poor habitat as density rises, and what the isodar’s slope reveals.

Jul 3, 2026
The ideal free distribution
ecology tutorial
R
foraging
behaviour
habitat selection

The ideal free distribution in R: how equal competitors free to move distribute across patches to equalise their intake, and why the result is input matching.

Jul 2, 2026
Checking a source-sink analysis
ecology tutorial
R
population ecology
model diagnostics
conservation

Three checks for a source-sink study in R: why counts mislead, separating local recruits from immigrants, and defining a source by contribution not just growth.

Jul 2, 2026
Why sinks hold high density
ecology tutorial
R
population ecology
conservation
habitat selection

Why a sink can hold more animals than the source that feeds it, worked in R, and why population density alone is a treacherous guide to habitat quality.

Jul 2, 2026
Ecological traps and pseudo-sinks
ecology tutorial
R
population ecology
conservation
habitat selection

Two ways a sink deceives, in R: an ecological trap that lures settlers into poor habitat, and a pseudo-sink that looks doomed but persists when isolated.

Jul 2, 2026
Source-sink population dynamics
ecology tutorial
R
population ecology
conservation
metapopulations

Source-sink dynamics in R: the BIDE budget, why a sink population persists only on immigration from a source, and what the local growth rate really measures.

Jul 2, 2026
Checking a life-history analysis
ecology tutorial
R
life history
model diagnostics
evolutionary ecology

Three checks for a life-history study in R: matching the fitness currency, the acquisition-allocation trap that hides trade-offs, and detecting bet-hedging.

Jul 2, 2026
The optimal germination fraction
ecology tutorial
R
life history
evolutionary ecology
plant ecology

Delayed germination as bet-hedging in R: Cohen’s model of the optimal fraction of seeds to germinate in a variable environment, and why it is less than one.

Jul 1, 2026
Bet-hedging and geometric mean fitness
ecology tutorial
R
life history
evolutionary ecology
bet-hedging

Why fitness in a variable environment is the geometric mean, not the arithmetic: bet-hedging in R, and how a lower-mean, steadier strategy wins the long run.

Jul 1, 2026
Life-history trade-offs in R
ecology tutorial
R
life history
evolutionary ecology
population ecology

Life-history trade-offs in R: the cost of reproduction, the optimal reproductive effort, and Cole’s paradox on why iteroparity pays when juveniles die young.

Jul 1, 2026
Checking an Allee analysis
ecology tutorial
R
population ecology
model diagnostics
conservation

Three checks for an Allee effect in R: why detection needs low-density data, how sampling error fakes density dependence, and strong versus weak Allee.

Jul 1, 2026
Component and demographic Allee effects
ecology tutorial
R
population ecology
behaviour
conservation

Component versus demographic Allee effects in R: how a mate-finding shortfall at low density scales up to a population threshold, and when it stays harmless.

Jul 1, 2026
Allee effects and extinction risk
ecology tutorial
R
population ecology
conservation
extinction

Allee effects and extinction risk in R: why demographic stochasticity endangers populations above the critical density, and why small introductions fail.

Jul 1, 2026
Allee effects and thresholds in R
ecology tutorial
R
population ecology
conservation
population dynamics

Allee effects in R: strong versus weak, the critical density as an unstable equilibrium, and the extinction threshold a shrinking population must clear.

Jul 1, 2026
Checking a foraging analysis
ecology tutorial
R
foraging
model diagnostics
behaviour

Three checks for a foraging study in R: prey depletion in functional-response trials, telling type II from type III, and which currency the forager maximises.

Jun 30, 2026
Functional responses in R
ecology tutorial
R
foraging
species interactions
predation

Holling’s functional responses in R: the type I, II and III curves, fitting the disc equation with nls, and why handling time sets a hard ceiling on intake.

Jun 30, 2026
Diet choice and the zero-one rule
ecology tutorial
R
foraging
behaviour
species interactions

The prey model in R: rank prey by profitability, the zero-one rule, and why a poor prey’s place in the diet depends only on how common the good prey are.

Jun 30, 2026
The marginal value theorem
ecology tutorial
R
foraging
behaviour
optimisation

The marginal value theorem in R: the optimal time to leave a patch, the tangent that solves it, and why a richer environment means leaving each patch sooner.

Jun 30, 2026
Checking a thermal performance analysis
ecology tutorial
R
thermal ecology
model diagnostics
physiology

Three checks for a thermal performance curve in R: the extrapolated critical maximum, curve-family dependence, and measurement error in body temperature.

Jun 30, 2026
Thermal safety margins and warming
ecology tutorial
R
thermal ecology
climate change
biogeography

Thermal safety margins in R: why tropical ectotherms, already living close to their optimum, lose performance under warming while temperate species gain.

Jun 30, 2026
Jensen’s inequality and thermal variability
ecology tutorial
R
thermal ecology
climate change
physiology

Jensen’s inequality on a thermal performance curve: fluctuating-temperature performance is not performance at the mean, and the best mean is below the optimum.

Jun 29, 2026
Thermal performance curves in R
ecology tutorial
R
thermal ecology
climate change
physiology

Fitting thermal performance curves in R with nls: the optimum, the critical thermal maximum and breadth, and why a symmetric curve misplaces the upper limit.

Jun 29, 2026
Checking a biodiversity-function analysis
ecology tutorial
R
biodiversity
ecosystem function
community ecology
model diagnostics

Three checks for a biodiversity-ecosystem function partition in R: the monoculture references, additive versus substitutive designs, and one dominant species.

Jun 29, 2026
Partitioning the net biodiversity effect
ecology tutorial
R
biodiversity
ecosystem function
community ecology

The Loreau-Hector additive partition in R from scratch: split the net biodiversity effect into complementarity and selection, and see the identity hold.

Jun 29, 2026
Complementarity and selection effects
ecology tutorial
R
biodiversity
ecosystem function
community ecology

Why the biodiversity selection effect is a covariance, not a mechanism: the Price-equation link, and what the additive partition cannot tell you about cause.

Jun 29, 2026
Biodiversity and ecosystem function in R
ecology tutorial
R
biodiversity
ecosystem function
community ecology

The biodiversity-ecosystem function relationship in R: relative yields, overyielding, and why beating the average monoculture differs from beating the best.

Jun 29, 2026
Checking a joint species distribution model
R
JSDM
community ecology
ecology tutorial
ggplot2

Three checks for a species association matrix in R: how big the strongest pair gets under a null, what presence-absence costs, and what missing effort does.

Jun 29, 2026
Co-occurrence is not interaction
R
JSDM
community ecology
ecology tutorial
ggplot2

Why a residual correlation between two species cannot identify competition in R: an observational equivalence, an unidentified arrow, and a missing gradient.

Jun 28, 2026
Latent variables and species correlations
R
JSDM
community ecology
ecology tutorial
ggplot2

Shrink a species correlation matrix with latent factors in R: the exact rotation invariance, how to choose the number of factors, and what low rank really buys.

Jun 28, 2026
Joint species distribution models in R
R
JSDM
community ecology
ecology tutorial
ggplot2

Fit a whole community at once in R: what joint modelling changes, what it leaves exactly unchanged, and why the residual correlation matrix is the real product.

Jun 28, 2026
Checking an allometric analysis
R
allometry
body size
model diagnostics
ecology tutorial

Three diagnostics for a scaling exponent: where the leverage sits, how much size range separates 2/3 from 3/4, and what shared ancestry does to the test.

Jun 28, 2026
Testing isometry and comparing slopes
R
allometry
body size
hypothesis testing
ecology tutorial

Is the exponent really 3/4? Testing a hypothesised allometric slope, comparing slopes between groups, and separating elevation from a shift along the line.

Jun 28, 2026
SMA or OLS for a scaling exponent?
R
allometry
body size
measurement error
regression
ecology tutorial

The standardised major axis is ordinary least squares divided by the correlation: why that identity makes SMA steeper, and when it is the unbiased choice.

Jun 28, 2026
Allometry and log-log regression in R
R
allometry
body size
regression
ecology tutorial

Fit an allometric exponent on the log scale, then back-transform without losing biomass: retransformation bias, and which error model your data support.

Jun 27, 2026
Checking an adaptive sampling design
R
adaptive sampling
survey design
model checking
ecology tutorial

Three checks before you run adaptive cluster sampling in the field: the condition threshold, the budget you might actually spend, and network double-counting.

Jun 27, 2026
When does adaptive sampling pay?
R
adaptive sampling
survey design
abundance
ecology tutorial

Two ways to count the cost of adaptive cluster sampling: compare it fairly with simple random sampling in R at equal initial effort and at equal total effort.

Jun 27, 2026
Horvitz-Thompson for adaptive samples
R
adaptive sampling
survey design
abundance
ecology tutorial

Estimate abundance from an adaptive cluster sample with the Horvitz-Thompson estimator: network inclusion probabilities in R, and why it beats Hansen-Hurwitz.

Jun 27, 2026
Adaptive cluster sampling in R
R
adaptive sampling
survey design
abundance
ecology tutorial

Build adaptive cluster sampling from scratch in R for rare, clustered species: networks, edge units, why the naive mean is biased, and the Hansen-Hurwitz fix.

Jun 27, 2026
Checking a stratified design
R
survey design
model checking
ecology tutorial

Three diagnostics for stratified survey estimates in R: post-stratification instability, weights that no longer match the frame, and far too many strata.

Jun 27, 2026
Two-phase sampling when strata are unknown
R
survey design
sampling
ecology tutorial

Double sampling in R: a large cheap first phase builds the strata, a small expensive second phase measures the response, and the budget split follows a formula.

Jun 27, 2026
Allocating survey effort across strata
R
survey design
sampling
ecology tutorial

Equal, proportional, Neyman and cost-aware allocation in R: which strata deserve more plots, what the optimum is worth, and how much a noisy pilot costs you.

Jun 26, 2026
Stratified random sampling in ecology
R
survey design
sampling
ecology tutorial

Stratified random sampling in R from first principles: the weighted estimator, its design variance, and why splitting a landscape into strata sharpens a mean.

Jun 26, 2026
Checking a monitoring design
R
survey design
monitoring
ecology tutorial

Three checks on a monitoring plan in R: what a short pilot does to power, which kind of site dropout biases a trend, and why observer drift is invisible.

Jun 26, 2026
Power to detect a population trend
R
survey design
monitoring
ecology tutorial

Turn monitoring variance components into statistical power in R, and why extra years buy far more than extra sites, with a ceiling no sample size removes.

Jun 26, 2026
Revisit designs for long-term monitoring
R
survey design
monitoring
ecology tutorial

Four revisit schedules on one annual budget in R: re-using sites sharpens the trend and blurs the regional mean, and the design enters through one matrix.

Jun 26, 2026
Variance components in monitoring data
R
survey design
monitoring
ecology tutorial

Split monitoring data into site, year, interaction and residual variance in base R, and see why the largest component is free for trend and fatal for status.

Jun 26, 2026
Checking a survey design
R
survey design
model diagnostics
monitoring
ecology tutorial

Three diagnostics for a spatially balanced ecological survey in R: realised inclusion probabilities, systematic grid aliasing, and what the frame leaves out.

Jun 25, 2026
Unequal-probability spatial sampling
R
survey design
spatial statistics
monitoring
ecology tutorial

Oversampling a rare habitat with GRTS, and why the plain sample mean is then biased. The Horvitz-Thompson estimator for unequal inclusion probabilities in R.

Jun 25, 2026
Design-based variance and spatial balance
R
survey design
spatial statistics
monitoring
ecology tutorial

A spatially balanced survey is more precise, but the textbook variance formula does not know it. Estimating design-based variance for GRTS samples in R.

Jun 25, 2026
Spatially balanced sampling with GRTS
R
survey design
spatial statistics
monitoring
ecology tutorial

Design-based sampling for ecological monitoring: the Horvitz-Thompson estimator, and GRTS from scratch in R to spread survey sites evenly across a landscape.

Jun 25, 2026
Checking a forecast evaluation
R
forecasting
model evaluation
model diagnostics
ecology tutorial

Three checks for an ecological forecast evaluation in R: coverage rewards width, sharpness needs calibration, and small test sets cannot separate two forecasts.

Jun 25, 2026
Forecast skill and the baseline
R
forecasting
model evaluation
ecology tutorial

A raw forecast score means nothing without a baseline. In R, the same ecological forecast is skilful against one reference and useless against another.

Jun 25, 2026
The CRPS and the Brier score
R
forecasting
model evaluation
ecology tutorial

Two proper scores for ecological forecasts: the Brier score for presence, the CRPS for abundance, built from scratch in R with the identities linking them.

Jun 25, 2026
Scoring ecological forecasts
R
forecasting
model evaluation
ecology tutorial

A point forecast and its RMSE throw away the uncertainty. Proper scoring rules reward an honest probabilistic forecast of ecological outcomes, worked in R.

Jun 24, 2026
Checking a niche comparison
R
niche overlap
model checking
species distribution models
ecology tutorial

A checklist for niche overlap analyses in R: bandwidth sensitivity, realised versus fundamental niches, and the direction-dependence of the similarity test.

Jun 24, 2026
Niche overlap and the background
R
niche overlap
species distribution models
biogeography
ecology tutorial

Measured niche overlap in R depends on the background, not just on the species: with preferences held fixed, Schoener’s D shifts as availability changes.

Jun 24, 2026
Niche equivalency and similarity tests
R
niche overlap
hypothesis testing
species distribution models
ecology tutorial

Permutation tests for niche overlap in R: the equivalency test asks if two species share a niche, the similarity test whether they are more alike than chance.

Jun 24, 2026
Niche overlap: Schoener’s D and Warren’s I
R
niche overlap
species distribution models
ecology tutorial

Measuring environmental niche overlap between two species in R with Schoener’s D and Warren’s I, the density-comparison metrics behind ENMTools and ecospat.

Jun 24, 2026
Checking a multi-model analysis
R
multimodel inference
model averaging
model checking
ggplot2
ecology tutorial

Three diagnostics for a multi-model analysis in R: selection bias and the winner’s curse, candidate-set dependence, and when the truth is not in the set.

Jun 24, 2026
Model-averaged coefficients: a caution
R
multimodel inference
model averaging
collinearity
ggplot2
ecology tutorial

Model-averaged regression coefficients mislead under collinearity in ecology (Cade 2015). Average predictions, not coefficients: a worked R demonstration.

Jun 23, 2026
Model-averaged predictions
R
multimodel inference
model averaging
prediction
ggplot2
ecology tutorial

Why model-averaged predictions beat picking one best model in R: an unconditional interval that accounts for selection uncertainty and covers correctly.

Jun 23, 2026
Akaike weights and evidence ratios
R
multimodel inference
model averaging
AIC
ggplot2
ecology tutorial

How to turn AICc differences into Akaike weights and evidence ratios in R, and read variable importance honestly when no single ecological model wins.

Jun 23, 2026
Checking a dispersal kernel
R
dispersal
seed dispersal
model checking
ecology tutorial

Three checks for a fitted seed dispersal kernel in R: how far the tail rests on a few seeds, whether the trap window truncates it, and if the family matters.

Jun 23, 2026
The mean dispersal distance
R
dispersal
seed dispersal
statistics
ecology tutorial

The mean dispersal distance averages over the far tail a seed-trap study never samples. Why it is fragile, sometimes infinite, and what to report instead, in R.

Jun 23, 2026
Fat-tailed dispersal kernels
R
dispersal
seed dispersal
population ecology
ecology tutorial

Thin-tailed and fat-tailed dispersal kernels fit the same seed-trap data yet disagree by orders of magnitude on long-distance dispersal. A comparison in R.

Jun 23, 2026
Fitting dispersal kernels in R
R
dispersal
seed dispersal
spatial ecology
ecology tutorial

Seed-trap distances are not the dispersal kernel. Fitting a 2D dispersal kernel to distance data in R, and why the missing ring-area factor doubles the scale.

Jun 23, 2026
Checking a phenology analysis
R
phenology
model checking
ggplot2
ecology tutorial

Three checks for a phenology analysis in R: effort sensitivity by thinning, survey-window censoring, and whether first, mean and median agree on the trend.

Jun 22, 2026
Phenological trends and temperature
R
phenology
climate change
ggplot2
ecology tutorial

Estimate phenological sensitivity to temperature in R, and see how rising effort in warm years inflates the first-date trend while the mean date holds.

Jun 22, 2026
First flowering dates and sampling effort
R
phenology
extreme values
ggplot2
ecology tutorial

Why the first flowering date advances as monitoring effort grows while the mean date stays put: the extreme-value bias behind phenological shifts, in R.

Jun 22, 2026
Phenology in R: day of year and event timing
R
phenology
ggplot2
ecology tutorial

Turn field dates into day of year and measure phenological event timing in R: first, mean, median, peak and duration, and which summary to report for a season.

Jun 22, 2026
Checking a food web analysis
R
food webs
model checking
community ecology
ecology tutorial

Three checks for a food web analysis in R: sampling effort biases connectance, the null model decides significance, and stability hinges on self-regulation.

Jun 22, 2026
Stability and complexity in food webs
R
food webs
stability
community ecology
ecology tutorial

May’s stability criterion in R: build community matrices, find when large complex systems lose stability, and why predator-prey structure moves the boundary.

Jun 22, 2026
The niche model of food webs
R
food webs
ecological networks
community ecology
ecology tutorial

The niche model of food webs in R, compared with the cascade and random models: one feeding axis reproduces real structure, while a random graph does not.

Jun 21, 2026
Food web structure: connectance and trophic level
R
food webs
ecological networks
community ecology
ecology tutorial

Build a food web in R and measure its structure: connectance, trophic levels and food-chain length, and why the trophic level you report is a modelling choice.

Jun 21, 2026
Checking a metapopulation model
R
metapopulation
spatial ecology
model checking
ecology tutorial

Three diagnostics for a spatial metapopulation model in R: the equilibrium assumption, a weakly identified dispersal kernel, and stochastic extinction risk.

Jun 21, 2026
Metapopulation capacity
R
metapopulation
spatial ecology
conservation
ecology tutorial

Compute metapopulation capacity in R as the leading eigenvalue of the landscape matrix, rank patches by conservation value, and test the persistence threshold.

Jun 21, 2026
The incidence function model
R
metapopulation
spatial ecology
imperfect detection
ecology tutorial

Fit Hanski’s incidence function model to one snapshot of patch occupancy in R: patch area drives extinction, connectivity drives colonisation of empty patches.

Jun 21, 2026
The Levins metapopulation model
R
metapopulation
population dynamics
ecology tutorial

The Levins model of patch occupancy from scratch in R: the colonisation-extinction balance, the equilibrium fraction, and the extinction threshold it implies.

Jun 21, 2026
Checking a coexistence analysis
R
coexistence
competition
model checking
ecology tutorial

Three diagnostics for an annual plant coexistence result in R: mutual invasibility, whether your design identifies self-limitation, and stability to model form.

Jun 21, 2026
Assumptions behind coexistence
R
coexistence
competition
model checking
ecology tutorial

A coexistence verdict extrapolates far past the competition data. See in R how model form and demographic rates decide the outcome where no data constrain it.

Jun 20, 2026
Niche and fitness differences
R
coexistence
competition
population ecology
ecology tutorial

Turn fitted annual plant competition coefficients into niche and fitness differences in R, and see why the stronger competitor need not exclude its rival.

Jun 20, 2026
Fitting annual plant competition models
R
competition
coexistence
population ecology
ecology tutorial

Fit Beverton-Holt competition coefficients to annual plant fecundity data in R, and see why the experimental design decides which coefficients you can estimate.

Jun 20, 2026
Checking a stable isotope mixing model
R
stable isotopes
Bayesian statistics
diet
model checking
ecology tutorial

Three checks for a stable isotope mixing model in R: is the consumer inside the mixing polygon, is the posterior data-driven, and does source aggregation hold.

Jun 20, 2026
Discrimination and concentration in mixing models
R
stable isotopes
diet
food web
ecology tutorial

In stable isotope mixing models the assumed discrimination factor and elemental concentrations drive the diet estimate more than the consumer data do.

Jun 20, 2026
Bayesian stable isotope mixing models
R
stable isotopes
Bayesian statistics
diet
MCMC
ecology tutorial

Build a Bayesian stable isotope mixing model from scratch in R with a Metropolis sampler, and read the wide, correlated posterior that two tracers produce.

Jun 20, 2026
Stable isotope mixing models in R
R
stable isotopes
diet
food web
ecology tutorial

The geometry behind stable isotope mixing models in R: mass balance, the mixing polygon, and why more diet sources than tracers leave the answer undetermined.

Jun 20, 2026
Checking a social network analysis
R
social networks
model checking
animal behaviour
ecology tutorial

Three checks for an animal social network in R: the effort confound on centrality, the power to detect real structure, and the group definition it rests on.

Jun 19, 2026
Network centrality and sampling effort
R
social networks
network centrality
animal behaviour
ecology tutorial

Degree, strength and eigenvector centrality for an animal social network in R: each measures something different, and all three rise with sighting effort.

Jun 19, 2026
Permutation tests for social networks
R
social networks
permutation tests
null models
ecology tutorial

Data-stream versus node permutation for animal social networks in R: the label shuffle inflates false positives to almost one, the pre-network null does not.

Jun 19, 2026
Association indices for social networks
R
social networks
animal behaviour
association index
ecology tutorial

Turn group sightings into a weighted animal social network in R: the simple ratio and half-weight association indices by hand, and when the choice matters.

Jun 19, 2026
From a field sheet to your first analysis
R
dplyr
tidyr
ecology tutorial

A worked R pipeline for ecologists: read a messy field sheet, clean species names, reshape and join, then compute diversity, letting cleaning decide the result.

Jun 19, 2026
Joining ecological tables without losing zeros
R
dplyr
data wrangling
ecology tutorial

Joining tables in R with dplyr: why an inner join silently drops the sites where a species was absent and biases abundance, and how a left join keeps the zeros.

Jun 19, 2026
Summarising ecological data by group
R
dplyr
data wrangling
ecology tutorial

Grouped summaries in R with dplyr: group_by and summarise, and why the mean of per-site proportions is not the pooled proportion when sampling effort varies.

Jun 18, 2026
Setting up R and RStudio for ecology
R
RStudio
reproducibility
ecology tutorial

A first R session for ecologists: RStudio projects instead of setwd, installing packages once, and why a clean-session script is the only reproducible analysis.

Jun 18, 2026
Your first ggplot: data, aes and geom
R
ggplot2
data visualisation
ecology tutorial

Build a plot from three pieces: a data frame, an aes mapping and a geom. Learn the one beginner error, colour inside aes versus outside, that trips everyone.

Jun 18, 2026
Cleaning species names before you count
R
data import
community ecology
biodiversity
ecology tutorial

One species written six ways becomes six species in your richness count. Clean names with trimws, tolower and a lookup table before fuzzy matching traps you.

Jun 18, 2026
Wide and long: reshaping species data
R
data import
community ecology
ecology tutorial
tidyr

Move a species table between wide and long shape with pivot_longer, pivot_wider and xtabs, and see what a field notebook loses because it cannot write a zero.

Jun 18, 2026
Reading field data into R
R
data import
missing data
ecology tutorial
vegan

Read a field spreadsheet into R with read.csv, see why empty cells arrive as NA, and measure what replacing every NA with a zero does to a Shannon index.

Jun 18, 2026
Mark resight abundance estimation in R
R
abundance
capture-recapture
imperfect detection
ecology tutorial

Poisson log-normal mark resight from scratch: why the estimate runs slightly high, why heterogeneity destroys the interval, and what the marks cannot say.

Jun 18, 2026
Density surface models for distance sampling
R
distance sampling
abundance
imperfect detection
ecology tutorial

Two-stage density surface modelling in R: fitting a detection function, a spatial GAM on segments, and the variance term the naive interval leaves out.

Jun 17, 2026
Double constrained correspondence analysis in R
R
ordination
functional traits
community ecology
ecology tutorial

dc-CA from scratch in R: whitening turns co-inertia into correlation, why that fixes RLQ’s proxy problem, and the symmetric trap it introduces instead.

Jun 17, 2026
RLQ analysis in R: traits, sites and environment
R
ordination
functional traits
community ecology
ecology tutorial

RLQ on three tables from scratch in base R: the exact co-inertia decomposition, and the measured cost of maximising covariance rather than correlation.

Jun 17, 2026
Checking a trait environment analysis
R
traits
functional ecology
community ecology
model diagnostics
ecology tutorial

A fourth corner correlation can come back highly significant when the true trait to environment link is exactly zero. The permutation null you pick decides it.

Jun 17, 2026
Intraspecific trait variability in R
R
traits
functional ecology
community ecology
ecology tutorial

Species mean traits from a database, or trait values measured in the plot? The decomposition that separates them, and what it does when the two cancel.

Jun 17, 2026
Community weighted means in R
R
traits
functional ecology
community ecology
ecology tutorial

The community weighted mean is the most reported trait statistic in ecology. What it measures, what it hides, and the identity linking it to the fourth corner.

Jun 17, 2026
Checking a beta diversity analysis
R
beta diversity
biodiversity
model checking
ecology tutorial

Three checks to run before interpreting a beta diversity result: sampling effort, the choice of metric, and the site set. Each one can flip the verdict.

Jun 16, 2026
Beta diversity as variance: LCBD and SCBD
R
beta diversity
LCBD
biodiversity
ecology tutorial

Computing BD, LCBD and SCBD from scratch in base R, with the exact sum-of-squares identity, the bound nobody quotes, and two measured traps in how LCBD is read.

Jun 16, 2026
Zeta diversity in R: beyond pairwise turnover
R
beta diversity
zeta diversity
biodiversity
ecology tutorial

Computing zeta diversity from first principles in base R, and a measurement showing why a power-law zeta decline is not evidence of niche-based assembly.

Jun 16, 2026
Multiplicative beta diversity with Hill numbers
R
beta diversity
biodiversity
Hill numbers
ecology tutorial

Why additive beta on the Gini-Simpson index is bounded by alpha, how Jost’s alpha fixes it, and the exact identity that turns Hill beta into the Sorensen index.

Jun 16, 2026
Checking a camera trap density estimate
R
camera traps
abundance
ecology tutorial

Three checks for a random encounter model density estimate in R: the independence filter, interval coverage in a patchy landscape, and where the error lives.

Jun 16, 2026
Staying time and the REST model in R
R
camera traps
abundance
movement ecology
ecology tutorial

The REST model estimates animal density from how long animals stay in view, with no external speed. Little’s law and Cauchy’s chord identity, tested in R.

Jun 16, 2026
Measuring animal speed from camera traps
R
camera traps
movement ecology
ecology tutorial

Camera traps sample fast animals more often, so the speed they report is biased upwards. Recover the true mean with the harmonic mean in R, plus activity level.

Jun 16, 2026
Camera trap density: the random encounter model
R
camera traps
abundance
movement ecology
ecology tutorial

Estimate animal density from camera trap encounter rates in R. The gas model derived, tested against a simulation, and the one quantity it cannot measure.

Jun 15, 2026
Checking a neutral model fit
R
neutral theory
model checking
likelihood
ecology tutorial

Three checks on a fitted neutral model in R: interval calibration, out-of-sample richness prediction on nested subsamples, and what stays unidentifiable.

Jun 15, 2026
The exact Ewens test: is your SAD neutral?
R
neutral theory
species abundance
hypothesis testing
ecology tutorial

Watterson’s exact test in R. Condition on richness, and the neutral null loses its free parameter. Measured power against three classic niche models of the SAD.

Jun 15, 2026
Dispersal limitation: fitting theta and m in R
R
neutral theory
biodiversity
dispersal
likelihood
ecology tutorial

Etienne’s sampling formula in base R. Why fitting Ewens to a dispersal-limited plot underestimates theta by two thirds, and how immigration repairs it.

Jun 15, 2026
Neutral theory in R: theta and the Ewens formula
R
neutral theory
biodiversity
species abundance
ecology tutorial

Fit Hubbell’s fundamental biodiversity number from scratch. The Ewens sampling formula, the exact likelihood, and why species richness is all the data you use.

Jun 15, 2026
Checking a community phylogenetics analysis
R
community phylogenetics
model checking
ggplot2
ecology tutorial

Three checks that decide whether an NRI result means anything: sweep the species pool, calibrate your own pipeline on null data, and break the branch lengths.

Jun 15, 2026
Phylogenetic beta diversity: UniFrac and PhyloSor
R
community phylogenetics
beta diversity
ape
ecology tutorial

Two communities can share no species and still be nearly identical. Build UniFrac and PhyloSor by hand in R, and find they are one metric wearing two names.

Jun 14, 2026
Null models for phylogenetic community structure
R
community phylogenetics
null models
ggplot2
ecology tutorial

The picante null model menu is really two questions plus a choice of species pool. Build both nulls by hand in R and see exactly where they part company.

Jun 14, 2026
Phylogenetic community structure: NRI and NTI in R
R
community phylogenetics
biodiversity
ggplot2
ecology tutorial

Raw MPD and MNTD are confounded with species richness in a plot. Build standardised effect sizes, NRI and NTI, by hand in R and learn to read their signs.

Jun 14, 2026
Checking an ABC analysis
R
stats
model checking
ecology tutorial

Three checks for approximate Bayesian computation in ecology: rank calibration of the sampler, posterior width of the answer, acceptance distance for the model.

Jun 14, 2026
ABC-MCMC and sequential ABC samplers
R
stats
ggplot2
ecology tutorial

Rejection ABC draws from the prior and throws almost all of it away. ABC-MCMC and sequential Monte Carlo recycle the good draws; a Ricker model prices the gain.

Jun 14, 2026
Choosing summary statistics for ABC
R
approximate Bayesian computation
simulation
ecology tutorial

In ABC the summaries are the data. Sufficiency, the price of a useless summary, distance scaling and semi-automatic ABC, in R on normal and Ricker models.

Jun 14, 2026
Approximate Bayesian computation from scratch
R
approximate Bayesian computation
simulation
ecology tutorial

Fitting an ecological model you can simulate but cannot write a likelihood for. Rejection ABC by hand in R, and the exact price the tolerance charges.

Jun 14, 2026
Checking a wavelet analysis
R
wavelets
time series
model checking
ecology tutorial

Three ways a wavelet scalogram misleads you: a scale bias in the global spectrum, an event that impersonates a cycle, and the resolution knob you never set.

Jun 13, 2026
Wavelet coherence and phase
R
wavelets
time series
species interactions
ecology tutorial

Do two ecological series cycle together, and which one leads? Build wavelet coherence and phase by hand in R, and learn why the answer needs smoothing first.

Jun 13, 2026
Wavelet significance and the red noise null
R
wavelets
time series
hypothesis testing
ecology tutorial

A scalogram is thousands of tests at once. Why a white noise null flags much of the map, and how to test blobs rather than pixels in R against red noise.

Jun 13, 2026
Wavelet analysis of population cycles
R
wavelets
time series
spectral analysis
ecology tutorial

Build a Morlet continuous wavelet transform from scratch in R and see why a periodogram cannot tell you when an ecological cycle was actually running.

Jun 13, 2026
Checking a distance sampling model
R
distance sampling
model checking
abundance
ecology tutorial

The goodness-of-fit test accepts surveys whose density is 12 per cent wrong, and the assumption that matters most leaves no trace in the likelihood at all.

Jun 13, 2026
Hierarchical distance sampling
R
distance sampling
abundance
imperfect detection
ecology tutorial

One visit with distances beats three visits of counts in R, and the reason is a biological bet about whether your animals hold still between survey visits.

Jun 13, 2026
Point transect distance sampling
R
distance sampling
imperfect detection
abundance
ecology tutorial

Points are not short lines. The estimator reads the slope of your distance distribution at zero, which is why the same wrong key function costs more here.

Jun 12, 2026
Covariates in the detection function
R
distance sampling
imperfect detection
abundance
ecology tutorial

Pooling one detection function across strata keeps the total density roughly right and gets the comparison between strata badly wrong. Worked in base R.

Jun 12, 2026
Checking an open-population model
R
capture-recapture
model diagnostics
population ecology
ecology tutorial

Capture-recapture goodness-of-fit tests are computed on the m-array. Work out what that leaves out, and why a clean test is no licence to believe the abundance.

Jun 12, 2026
The robust design and temporary emigration
R
capture-recapture
abundance
population ecology
ecology tutorial

Nest closed periods inside an open study, fit the three-state model by hand, and find out which parameter absorbs the damage when detection is not constant.

Jun 12, 2026
Pradel seniority: growth rate from reverse time
R
capture-recapture
population growth
population ecology
ecology tutorial

Run the same CJS likelihood on reversed capture histories to get seniority, turn it into a population growth rate, and see why its standard error lies.

Jun 12, 2026
Jolly-Seber and POPAN: abundance from marks
R
capture-recapture
abundance
population ecology
ecology tutorial

Fit the Jolly-Seber superpopulation model by hand in base R, see where abundance comes from, and watch it collapse when first capture differs from recapture.

Jun 12, 2026
Checking an occupancy variant
R
occupancy
imperfect detection
model checking
ecology tutorial

Four latent stories, one set of detection frequencies. What goodness of fit and model selection can decide about occupancy models, and what they cannot.

Jun 12, 2026
False positives in occupancy models
R
occupancy
imperfect detection
ecology tutorial

Why a five per cent misidentification rate inflates an occupancy estimate in R, and how the label swap leaves two answers that fit the detection data alike.

Jun 11, 2026
Two-species occupancy and interactions
R
occupancy
imperfect detection
species interactions
ecology tutorial

Fitting the Rota multispecies occupancy model by hand in R, and watching a shared habitat gradient manufacture a species interaction that is not really there.

Jun 11, 2026
The Royle-Nichols model: abundance from detections
R
occupancy
imperfect detection
abundance
ecology tutorial

How repeat visits let an occupancy model estimate abundance in R, why the trick works, and why unmodelled detection heterogeneity is read as abundance.

Jun 11, 2026
Checking a MAR(1) model
R
MAR models
model diagnostics
time series
ecology tutorial

Observation error drags every MAR(1) stability metric towards calm while residual diagnostics stay silent. Here is the size of it, and why residuals miss it.

Jun 11, 2026
Community stability from a MAR(1) model
R
MAR models
stability
community ecology
ecology tutorial

Turn a fitted interaction matrix into return rate, reactivity and variance ratios in base R, and see which stability reading survives more than one species.

Jun 11, 2026
Interaction strengths from community time series
R
MAR models
time series
species interactions
ecology tutorial

What a MAR(1) coefficient means, how much a sixty-point series can say about it, and why a shared environment quietly ruins the off-diagonal estimates.

Jun 11, 2026
Fitting a MAR(1) model to community time series
R
MAR models
time series
community ecology
ecology tutorial

Fit a multivariate autoregressive model to a plankton-like community in base R, and see why the single-species AR(1) shortcut answers a different question.

Jun 10, 2026
Checking an empirical dynamic model
R
EDM
causality
model checking
ecology tutorial

Three diagnostics for EDM where the truth is known: series length, shared drivers and synchrony. What convergent cross mapping catches, and what it cannot.

Jun 10, 2026
Convergent cross mapping in ecology
R
EDM
causality
time series
ecology tutorial

Detect which species drives which from time series alone. Build CCM in base R, read the direction, and see why convergence is the test, not correlation.

Jun 10, 2026
The S-map and state-dependent dynamics
R
EDM
time series
nonlinear dynamics
ecology tutorial

Build the S-map in base R, test whether population dynamics are state dependent, and see when its interaction coefficients are real and when they are noise.

Jun 10, 2026
Simplex projection and delay embedding
R
EDM
time series
nonlinear dynamics
ecology tutorial

Reconstruct a population’s attractor from one time series, forecast it with simplex projection in base R, and separate deterministic dynamics from red noise.

Jun 10, 2026
Checking a network analysis
R
ecological networks
species interactions
ggplot2
ecology tutorial

How far sampling effort, network size and unseen links move connectance, H2’ and nestedness, what a null model rescues, and what the matrix can never tell you.

Jun 10, 2026
Null models for interaction networks
R
ecological networks
species interactions
ggplot2
ecology tutorial

Why a network metric means nothing on its own: three nulls in base R, a nestedness verdict that flips with the null, and a web’s tolerance of species loss.

Jun 10, 2026
Modularity in ecological networks
R
ecological networks
species interactions
ggplot2
ecology tutorial

Barber’s bipartite modularity, a hand-coded label-propagation module finder, the c-z role plot and a null-model test, in base R on a plant-pollinator web.

Jun 9, 2026
Bipartite network metrics from scratch
R
ecological networks
species interactions
ggplot2
ecology tutorial

Connectance, generality, vulnerability and the specialisation indices H2’ and d’ for a plant-pollinator web, in base R, with the sampling caveats spelled out.

Jun 9, 2026
Checking a survival model
R
survival analysis
model checking
ecology tutorial

Diagnostics for survival models: the proportional hazards test, martingale residuals for functional form, and Cox-Snell residuals. None proves the model right.

Jun 9, 2026
Frailty and recurrent event models
R
survival analysis
ecology tutorial

Survival times that share a cluster or repeat within an individual are not independent: the naive model understates uncertainty, and units limit the correction.

Jun 9, 2026
Parametric survival and the AFT model
R
survival analysis
ecology tutorial

A parametric survival model reads a covariate two ways, as a clock acceleration or a hazard ratio, and predicts absolute survival that Cox cannot give directly.

Jun 9, 2026
Competing risks and cumulative incidence
R
survival analysis
competing risks
ecology tutorial

When animals die from several mutually exclusive causes, one minus the Kaplan-Meier curve overstates each cause. Estimate the cumulative incidence function.

Jun 9, 2026
Checking an N-mixture model
R
abundance
imperfect detection
model checking
ecology tutorial

Diagnostics for a fitted N-mixture model in base R: a parametric-bootstrap fit test, site-level quantile residuals, and sensitivity to the abundance ceiling.

Jun 8, 2026
N-mixture reliability and the detection trade-off
R
abundance
imperfect detection
model checking
ecology tutorial

When an N-mixture abundance estimate is unreliable: unbounded estimates, weakly identified dispersion, and inflation from unmodelled detection heterogeneity.

Jun 8, 2026
Checking a circular analysis
R
circular statistics
model checking
ecology tutorial
ggplot2

Mean direction, concentration, uniformity verdicts and the overlap coefficient are decisions in disguise: what circular summaries hide, and how to report them.

Jun 8, 2026
Activity patterns and temporal overlap
R
circular statistics
camera traps
ecology tutorial
ggplot2

Camera-trap activity times as circular data: von Mises kernel density, the coefficient of overlap for temporal niche partitioning, and a bootstrap interval.

Jun 8, 2026
Testing for circular uniformity
R
circular statistics
hypothesis testing
ecology tutorial
ggplot2

Is there a preferred direction at all? The Rayleigh, Rao spacing, Kuiper and Watson tests in base R, and why the popular Rayleigh test misses two-way patterns.

Jun 8, 2026
Circular data and the von Mises distribution
R
circular statistics
directional data
ecology tutorial
ggplot2

Why arithmetic means fail on the circle: the mean direction and resultant length for animal orientations, and fitting a von Mises distribution in base R.

Jun 8, 2026
Checking an extreme value model
R
extreme value theory
statistics
ecology tutorial

Diagnose an extreme value fit in R with PP and QQ plots, test how far the return level moves with the threshold, and simulate what the interval really covers.

Jun 8, 2026
Return levels and uncertainty
R
extreme value theory
statistics
ecology tutorial

Honest intervals on extreme value return levels in R with profile likelihood, why the delta method is too narrow, and a trend with non-stationary GEV.

Jun 7, 2026
Peaks over threshold and the GPD
R
extreme value theory
statistics
ecology tutorial

Keep every value above a high threshold instead of one maximum per block: fit the generalised Pareto by hand in R, choose the threshold, decluster the extremes.

Jun 7, 2026
Block maxima and the GEV distribution
R
extreme value theory
statistics
ecology tutorial

Fit the generalised extreme value distribution to annual maxima in R from scratch, read the shape parameter, and see why the tail is hard to pin down.

Jun 7, 2026
Checking a bootstrap: when resampling fails
R
resampling
statistics
ecology tutorial

The bootstrap is not automatic. See how it breaks on small samples and non-smooth statistics, why its intervals undercover, and how to check before trusting it.

Jun 7, 2026
Bootstrapping dependent data: blocks and clusters
R
resampling
time series
ecology tutorial

Resampling single observations breaks dependence and understates uncertainty. Use block resampling for autocorrelated series and cluster resampling for groups.

Jun 7, 2026
The parametric bootstrap and a boundary problem
R
resampling
GLM
ecology tutorial

Simulate from a fitted model to build a null distribution the asymptotic chi-squared gets wrong, and test Poisson against negative binomial overdispersion.

Jun 7, 2026
The nonparametric bootstrap from scratch
R
resampling
statistics
ecology tutorial

Resample your data to approximate a sampling distribution, and build percentile, basic and BCa intervals by hand for a skewed ecological response ratio.

Jun 7, 2026
Checking early warning signals
early warning signals
time series
R
resilience
ecology tutorial

Surrogate tests, false-positive rates and the necessary-not-sufficient limit of early warning signals in R: a rising indicator is a hypothesis, not a forecast.

Jun 6, 2026
Spatial early warning signals
early warning signals
spatial statistics
R
resilience
ecology tutorial

Spatial variance, Moran’s I and spatial skewness measured on a coupled grazing lattice approaching a fold in R, with base stats only, and their caveats.

Jun 6, 2026
Detrending and bandwidth in early warning signals
early warning signals
time series
R
resilience
ecology tutorial

The same collapsing series, four defensible detrending choices, and two sensitivity sweeps in R: how analyst decisions drive an early warning trend statistic.

Jun 6, 2026
Early warning signals and critical slowing
early warning signals
time series
R
population dynamics
ecology tutorial

Rising lag-1 autocorrelation and variance as a grazed ecosystem nears a fold bifurcation in R, from a stochastic model with base stats and a rolling window.

Jun 6, 2026
Checking a time series model
R
time series
model checking
ecology tutorial

Diagnosing a time series model in base R: residual whiteness with Ljung-Box, prewhitening before cross-correlation, and why passing every check proves nothing.

Jun 6, 2026
Spectral analysis of population cycles
R
time series
spectral analysis
ecology tutorial

Periodograms for population cycles in R: why the raw version is noisy, how aliasing turns a fast cycle into a slow one, and why a peak needs a red-noise null.

Jun 6, 2026
Fitting ARIMA models to ecological time series
R
time series
forecasting
ecology tutorial

Identify an ARMA model from the ACF and PACF, fit it with arima() in base R, and avoid the twin traps of over-differencing and plug-in prediction intervals.

Jun 5, 2026
Temporal autocorrelation and effective sample size
R
time series
autocorrelation
ecology tutorial

How autocorrelation shrinks the effective sample size of a time series, why the naive correlation test between two series over-rejects, and how to correct it.

Jun 5, 2026
Checking a spatial regression
spatial
regression
model checking
diagnostics
ecology tutorial

Diagnose an areal spatial model with residual Moran’s I and Lagrange multiplier tests, compare SAR, CAR and filtering, and confront spatial confounding.

Jun 5, 2026
Moran eigenvector spatial filtering
spatial
regression
autocorrelation
GLM
ecology tutorial

Turn a spatial weights matrix into orthogonal map patterns, add them to a Poisson GLM to remove residual autocorrelation, and see where filtering falls short.

Jun 5, 2026
Conditional autoregressive (CAR) models
spatial
regression
autocorrelation
areal data
ecology tutorial

Build areal spatial dependence from local conditional distributions, fit a proper CAR by hand, contrast it with SAR, and use the intrinsic CAR as a smoother.

Jun 5, 2026
Spatial lag and spatial error models (SAR)
spatial
regression
autocorrelation
areal data
ecology tutorial

Fit simultaneous autoregressive models to areal ecological data by hand, separate spillover from nuisance autocorrelation, and read the spatial multiplier.

Jun 5, 2026
Checking a bounded-response model
R
ecology tutorial
regression
model checking

Deviance residuals mislead for beta, ordinal and Tweedie models. Use randomised quantile residuals, a proportional-odds test and held-out calibration instead.

Jun 5, 2026
Tweedie regression for biomass and cover with zeros
R
ecology tutorial
regression
GLM

Biomass and catch per unit effort mix exact zeros with a skewed positive part. Fit Tweedie regression with mgcv, and see why logging with a constant is biased.

Jun 4, 2026
Ordinal regression for ordered cover classes
R
ecology tutorial
regression
GLM

Braun-Blanquet cover classes are ordered categories, not numbers. Fit a proportional-odds model from scratch in R and check the parallel-slopes assumption.

Jun 4, 2026
Beta regression for proportion and cover data
R
ecology tutorial
regression
GLM
proportions

Vegetation cover and other continuous proportions live between zero and one. Fit beta regression from scratch in R, and see why logit plus OLS is biased.

Jun 4, 2026
Checking a model-based multivariate model
R
community ecology
model diagnostics
multivariate
ecology tutorial

A community-level test rests on two assumptions: the right mean-variance relationship, and resampling that keeps species correlated. How to check both in R.

Jun 4, 2026
Fourth-corner trait-environment analysis
R
community ecology
functional ecology
traits
ecology tutorial

The fourth-corner statistic links species traits to the environment through abundance. Its naive permutation test over-rejects; the max-of-p fix controls it.

Jun 4, 2026
Model-based unconstrained ordination
R
community ecology
multivariate
ordination
ecology tutorial

An NMDS axis can track sampling intensity rather than ecology when the mean-variance link is strong. A model-based ordination on residuals recovers it.

Jun 4, 2026
Model-based multivariate abundance
R
community ecology
multivariate
ecology tutorial

Distance-based community methods confound the mean-variance link with composition change. Model each species with a GLM, and test the community by resampling.

Jun 3, 2026
Checking predictive calibration and coverage
R
prediction
model checking
ecology tutorial

Do your model’s stated uncertainties hold up? Coverage calibration, PIT histograms and reliability diagrams with a Brier decomposition, on held-out data in R.

Jun 3, 2026
Conformal prediction intervals from scratch
R
prediction
uncertainty
ecology tutorial

Split and locally adaptive conformal intervals in base R: a distribution-free coverage guarantee, and the honest gap between marginal and conditional coverage.

Jun 3, 2026
Local regression from scratch
R
regression
nonparametric
ecology tutorial

Nadaraya-Watson and local linear regression in base R, bandwidth chosen by cross-validation, and why a variance-only band under-covers where the curve bends.

Jun 3, 2026
Gaussian process regression from scratch
R
regression
Gaussian processes
ecology tutorial

Fit a Gaussian process in base R along an ecological gradient: the RBF kernel, marginal-likelihood hyperparameters, and a posterior mean with a credible band.

Jun 3, 2026
Checking a tree ensemble
R
regression
machine learning
ecology tutorial

Variable importance, partial dependence and out-of-bag error have failure modes: where correlated predictors break them, and why prediction is not explanation.

Jun 3, 2026
Boosted regression trees, by hand
R
regression
machine learning
ecology tutorial

How gradient boosting builds a strong predictor from tiny trees, why the learning rate and tree count trade off, and how it overfits, built from scratch in R.

Jun 3, 2026
Bagging and random forests, by hand
R
regression
machine learning
ecology tutorial

Why averaging bootstrapped trees cuts variance, how out-of-bag error gives a free honest estimate, and what mtry actually buys, built from scratch in base R.

Jun 2, 2026
Regression trees and CART, by hand
R
regression
machine learning
ecology tutorial

How a regression tree splits, why the greedy tree is unstable and overfits, and how cost-complexity pruning by cross-validation trades bias against variance.

Jun 2, 2026
Checking a penalised regression
R
regression
regularisation
ecology tutorial

The coefficient table from a lasso or elastic net does not support the usual confidence intervals. A coverage experiment shows why, and what to do instead.

Jun 2, 2026
Elastic net and cross-validation
R
regression
regularisation
ecology tutorial

The elastic net mixes ridge and lasso penalties, keeping correlated predictors together where the lasso splits them, and is tuned by cross-validation.

Jun 2, 2026
Lasso and variable selection
R
regression
regularisation
ecology tutorial

The lasso adds an L1 penalty that sets coefficients exactly to zero, doing selection and shrinkage at once. How it works, and why the selected set is unstable.

Jun 2, 2026
Ridge regression for collinear predictors
R
regression
regularisation
ecology tutorial

Ridge regression stabilises least squares when ecological predictors are collinear and numerous: shrinkage, choosing the penalty, and the bias it buys.

Jun 2, 2026
Checking a generalised additive model
GAMs
model checking
diagnostics
ecology tutorial

Three checks before trusting a fitted GAM: residual autocorrelation that inflates wiggliness, a basis and concurvity screen, and what extrapolation follows.

Jun 1, 2026
Concurvity in additive models
GAMs
model checking
collinearity
ecology tutorial

Concurvity is the smooth analogue of collinearity: when one covariate is a curved function of another, their separate effects stop being identifiable in a GAM.

Jun 1, 2026
Choosing the basis dimension k in mgcv
GAMs
smoothing
model selection
ecology tutorial

The k in a GAM smooth is a ceiling on wiggliness, not the fit. Set it generously, let the penalty work, and check with k.check that the basis is large enough.

Jun 1, 2026
Penalised regression splines from scratch
GAMs
smoothing
regression
ecology tutorial

A cubic B-spline basis with a difference penalty, coded by hand and checked against mgcv: the penalty, not the basis degree, decides how wiggly a smooth is.

Jun 1, 2026
Checking a quantile regression
quantile regression
model diagnostics
R
ecology tutorial
ggplot2

Crossing lines, mechanical in-sample calibration, and a tail slope that rests on three points: the diagnostics that keep a quantile regression fit honest.

Jun 1, 2026
Distributional regression with location and scale
distributional regression
R
ecology tutorial
ggplot2

Model the spread, not just the mean. A base-R location-scale fit, why naive prediction intervals miscalibrate, and how it connects to quantile regression.

Jun 1, 2026
Heteroscedasticity and limiting factors
quantile regression
limiting factors
R
ecology tutorial
ggplot2

When an ecological variable sets an upper bound, the mean slope is about half of it. Upper quantiles recover the limiting relationship in base R, not its cause.

Jun 1, 2026
Quantile regression in ecology: beyond the mean
quantile regression
R
ecology tutorial
ggplot2

Least squares fits the mean; quantile regression fits any part of the response distribution. A from-scratch look at the check loss and its ecological uses.

May 31, 2026
Checking a threshold model
R
model diagnostics
ecology tutorial
ggplot2

Checking a fitted threshold in base R: read the residuals, see why the Wald breakpoint interval undercovers, and test the threshold under a different shape.

May 31, 2026
Threshold regression with a GLM
R
GLM
ecology tutorial
ggplot2

Threshold models for counts in base R: profile a Poisson GLM for the breakpoint, tell a slope change from an abrupt regime shift, and resist extra breakpoints.

May 31, 2026
Testing for an ecological threshold
R
hypothesis testing
ecology tutorial
ggplot2

Deciding whether a threshold is real in base R: the naive break test over-rejects, so bootstrap the null, and do not mistake a smooth curve for a kink.

May 31, 2026
Segmented regression for a breakpoint
R
regression
ecology tutorial
ggplot2

Fit a broken-stick model to an ecological threshold in base R: profile the residual sum of squares to place the breakpoint, and see why one line misleads.

May 31, 2026
Checking a nonlinear model
R
nonlinear regression
model checking
ecology tutorial

Checking an nls fit in R: spotting non-constant variance in the residuals, why Wald intervals under-cover, and why extrapolation is only a choice of form.

May 31, 2026
Starting values and identifiability in nls
R
nonlinear regression
model fitting
ecology tutorial

Why nls fails to converge, and why it converges to a parameter that was never identifiable: starting values, self-start models and flat likelihoods in R.

May 30, 2026
Fitting growth curves with nls
R
nonlinear regression
growth
ecology tutorial

Fit a von Bertalanffy growth curve in R with nls: why the Ford-Walford plot is noisier than direct fitting, and why the asymptote needs the ages sampled.

May 30, 2026
Nonlinear regression in R with nls
R
nonlinear regression
functional response
ecology tutorial

Fitting nonlinear models in R with nls: why linearising a functional response biases attack rate and handling time, and how direct least squares recovers them.

May 30, 2026
Checking a diversity estimate
R
species richness
model diagnostics
ecology tutorial

A richness estimate is only as sound as its rarest counts. Check sample coverage, singleton sensitivity and interval coverage in base R, and what it promises.

May 30, 2026
Estimating diversity with Hill numbers
R
diversity
biodiversity
ecology tutorial

Plug-in Hill numbers are biased low under incomplete sampling, and the bias depends on the order q. Correct them in base R, and see why richness is the hardest.

May 30, 2026
Coverage-based rarefaction and extrapolation
R
species richness
biodiversity
ecology tutorial

Comparing richness at equal sample size can rank two assemblages the wrong way. Standardise by coverage instead, in base R, and see where extrapolation stops.

May 30, 2026
Estimating species richness beyond your sample
R
species richness
biodiversity
ecology tutorial

Observed species counts undersample true richness. Estimate the unseen with Chao1, ACE and jackknife estimators in base R, and see why they stay lower bounds.

May 30, 2026
Checking a multiple-testing analysis
R
multiple testing
model diagnostics
ecology tutorial

Three diagnostics for a false-discovery-rate analysis: the p-value histogram, estimating the null proportion, and the sensitivity of the discovery set.

May 29, 2026
Dependence and the Benjamini-Yekutieli correction
R
multiple testing
false discovery rate
ecology tutorial

Benjamini-Hochberg assumes tests are independent or positively dependent. When ecological tests co-vary, Benjamini-Yekutieli is the safe choice, in base R.

May 29, 2026
The false discovery rate and Benjamini-Hochberg
R
multiple testing
false discovery rate
ecology tutorial

When you screen hundreds of taxa, Bonferroni discards real signal. Benjamini-Hochberg controls the false discovery rate instead, step by step in base R.

May 29, 2026
Family-wise error and the Bonferroni correction
R
multiple testing
hypothesis testing
ecology tutorial

Why running many ecological tests at 0.05 inflates the false-positive rate, and how the Bonferroni, Holm and Sidak corrections rein it back in, in base R.

May 29, 2026
Checking a compositional analysis
R
compositional data
ggplot2
reproducibility
ecology tutorial

Three diagnostics for a compositional result: does the verdict survive dropping a part, do the residuals behave, and what the unseen total can overturn.

May 29, 2026
Compositional analysis and the zero problem
R
compositional data
ggplot2
simulation
ecology tutorial

How closure turns one real change into many spurious ones, why log-ratios localise it correctly, and how to handle the zeros that log-ratios cannot take.

May 29, 2026
Log-ratio transformations: clr, alr and ilr
R
compositional data
ggplot2
ecology tutorial

Building the centred, additive and isometric log-ratio transformations by hand, with Aitchison distance, perturbation and powering, using base R only.

May 28, 2026
Closure and spurious correlation
R
compositional data
ggplot2
ecology tutorial

Why dividing counts by their total invents negative correlations between species that were independent, and why Pearson correlation on proportions misleads.

May 28, 2026
Checking missing-data assumptions
R
missing data
simulation
ggplot2
ecology tutorial

Probing the missing-at-random assumption in R: a logistic missingness check, an observed-versus-imputed diagnostic, and a delta shift sensitivity analysis.

May 28, 2026
Multiple imputation by chained equations
R
missing data
simulation
ggplot2
ecology tutorial

Multiple imputation coded by hand in R, with chained equations and Rubin’s rules: an unbiased slope and an honest standard error where single imputation fails.

May 28, 2026
Single imputation: bias and variance
R
missing data
ggplot2
ecology tutorial

Why single imputation misleads: mean imputation attenuates the slope, regression imputation inflates correlations, and one dataset hides the real uncertainty.

May 28, 2026
Missing data: MCAR, MAR and MNAR
R
missing data
ggplot2
ecology tutorial

The three missing-data mechanisms in R: why complete-case deletion stays unbiased under MCAR, shifts the mean under MAR, and biases the slope too under MNAR.

May 28, 2026
Checking a measurement-error correction
R
ecology tutorial
regression
measurement error
reproducibility

The measurement-error toolkit assumes you know the error size. Estimating reliability from replicates, checking whether to correct, and sensitivity analysis.

May 28, 2026
Correcting measurement error with SIMEX
R
ecology tutorial
regression
measurement error
simulation

SIMEX corrects measurement error by simulation: add known error, watch the estimate degrade, then extrapolate back to none. A from-scratch tutorial in R.

May 27, 2026
Errors-in-variables and Deming regression
R
ecology tutorial
regression
measurement error

When both variables carry error, ordinary regression is biased either way. Deming regression uses the error-variance ratio to recover the true slope in R.

May 27, 2026
Measurement error and regression dilution
R
ecology tutorial
regression
measurement error
simulation

Error in an environmental predictor biases regression slopes towards zero. See how the reliability ratio attenuates estimates in R, and how to correct them.

May 27, 2026
Placebo tests for panel causal designs
causal inference
ecology tutorial
R

With one treated unit, the usual standard errors are not to be trusted. Two placebo tests instead: permute the treatment across space, and move it back in time.

May 27, 2026
The synthetic control method
causal inference
ecology tutorial
R

For a single treated region, an average of comparison regions is a poor counterfactual. Build a weighted mix of donors that matches the pre-intervention path.

May 27, 2026
Staggered adoption and two-way fixed effects
causal inference
ecology tutorial
R

When units are treated at different times, two-way fixed effects quietly uses already-treated units as controls, and those forbidden comparisons go negative.

May 27, 2026
Event-study difference-in-differences
causal inference
ecology tutorial
R

A static BACI contrast gives one number. An event study splits it into a path over time, and turns the pre-intervention periods into a parallel-trends check.

May 26, 2026
Sensitivity to unmeasured confounding
causal inference
R
ecology tutorial

How strong must an unmeasured confounder be to overturn a causal finding? The E-value and Rosenbaum bounds in base R, calibrated against a known confounder.

May 26, 2026
Propensity score matching
causal inference
R
ecology tutorial

Nearest-neighbour propensity score matching by hand in R: match treated units to controls, estimate the ATT, and check balance with standardised differences.

May 26, 2026
Doubly robust estimation with AIPW
causal inference
R
ecology tutorial

Augmented inverse-probability weighting is doubly robust: the causal effect stays consistent when either the propensity or the outcome model is right.

May 26, 2026
G-computation and standardisation
causal inference
R
ecology tutorial

Standardisation and the g-formula for a marginal causal effect in R: fit an outcome model, predict potential outcomes under each treatment level, then average.

May 26, 2026
Propensity scores and IPW
R
causal inference
ecology tutorial

With many measured confounders, the propensity score balances the groups by weighting. Inverse-probability weighting, balance and overlap, built by hand in R.

May 26, 2026
Regression discontinuity design
R
causal inference
ecology tutorial

When a threshold decides who gets treated, the jump in the outcome at the cutoff estimates a local causal effect. Local-linear RDD built by hand in R.

May 26, 2026
Instrumental variables and 2SLS
R
causal inference
ecology tutorial

When an unmeasured confounder biases ordinary regression, a valid instrument and two-stage least squares can recover the causal effect. Built by hand in R.

May 25, 2026
Checking causal assumptions
causal inference
R
ecology tutorial
regression
sensitivity analysis

You cannot prove there is no hidden confounder, but you can check. Negative controls and the robustness value put honest bounds on an untestable premise.

May 25, 2026
Before-after-control-impact designs
causal inference
R
ecology tutorial
experimental design
regression

A before-after contrast confounds the impact with a trend and a control-impact contrast with a site difference: the BACI interaction differences both out in R.

May 25, 2026
Collider bias and selection
causal inference
R
ecology tutorial
regression
DAGs

Conditioning on a common effect, or sampling on it, manufactures an ecological correlation that is not there. Why adjusting for everything is a bad instinct.

May 25, 2026
Confounding and backdoor adjustment
causal inference
R
ecology tutorial
regression
DAGs

Why a naive regression gives a biased causal effect in ecology, and how the backdoor criterion says which covariates to adjust for and which to leave out.

May 25, 2026
Checking a structural equation model
R
structural equation models
model diagnostics
causal inference
ecology tutorial

Check a piecewise SEM in base R: calibrate Fisher’s C with a parametric bootstrap, and see why Markov-equivalent graphs fit alike and cannot orient the arrows.

May 25, 2026
Mediation and bootstrapped indirect effects
R
structural equation models
mediation
bootstrap
ecology tutorial

Estimate a mediated effect in base R, then compare the Sobel normal interval with a bootstrap percentile interval. Why the product a times b needs resampling.

May 25, 2026
Piecewise SEM and the test of d-separation
R
structural equation models
model diagnostics
GLM
ecology tutorial

Fit a structural equation model equation by equation with lm and glm, then test its causal structure with Shipley’s d-separation test and Fisher’s C in base R.

May 24, 2026
Path analysis: direct, indirect, and total effects
R
structural equation models
regression
ecology tutorial

Split an ecological correlation into direct and indirect routes with lm in base R: standardised path coefficients, the tracing rules, and why a slope misleads.

May 24, 2026
Checking for publication bias
meta-analysis
ecology tutorial
R
publication bias

Detect small-study effects in an ecological meta-analysis with base R: funnel plots, Egger’s regression test, and trim-and-fill, with the limits of each.

May 24, 2026
Meta-regression with moderators
meta-analysis
ecology tutorial
R
meta-regression

Explain heterogeneity with a study-level moderator in base R: weighted meta-regression, residual tau-squared, an R-squared analogue, and error control.

May 24, 2026
Heterogeneity in meta-analysis
meta-analysis
ecology tutorial
R
heterogeneity

Measure disagreement among ecological studies in base R: Cochran’s Q, I-squared with an interval, tau-squared, and a prediction interval for a new study.

May 24, 2026
Random-effects meta-analysis in R
meta-analysis
ecology tutorial
R
effect size

Pool effect sizes across ecological studies with a random-effects model in base R: Hedges’ g, DerSimonian-Laird and REML tau-squared, forest plots and coverage.

May 24, 2026
Checking an integrated SDM
data integration
model checking
species distribution
goodness of fit
ecology tutorial

A joint model can hide a conflict between its two data sources. Ordinary goodness of fit is fooled, but a source-conflict check tests whether they agree.

May 23, 2026
Spatial autocorrelation in occupancy models
occupancy
spatial statistics
autocorrelation
detection
ecology tutorial

A latent spatial gradient in occupancy inflates false positives for any structured covariate. Moran eigenvector filtering removes most of it, but not all.

May 23, 2026
Multi-scale occupancy models in R
occupancy
detection
hierarchical models
monitoring
ecology tutorial

A nested occupancy model separates site use, local availability and detection. Skip the middle scale and a single-scale fit quietly underestimates occupancy.

May 23, 2026
Integrated species distribution models in R
species distribution
data integration
point process
occupancy
ecology tutorial

Combine presence-only records with a structured occupancy survey in one likelihood, correcting sampling bias and sharpening the environmental response.

May 23, 2026
Checking a community occupancy model
ecology tutorial
R
occupancy
hierarchical models
Bayesian statistics
MCMC
model diagnostics

A community occupancy model can return sensible parameters yet fit badly. A posterior predictive check in base R catches unmodelled detection heterogeneity.

May 23, 2026
Community covariates and species traits
ecology tutorial
R
occupancy
hierarchical models
Bayesian statistics
MCMC
community ecology

Give each species its own slope on a site gradient, and use a trait to explain the variation. A hierarchical model in base R, set against the two-stage fit.

May 23, 2026
Species richness by data augmentation
ecology tutorial
R
occupancy
hierarchical models
Bayesian statistics
MCMC
biodiversity
species richness

Estimate how many species a survey missed. A community occupancy model with data augmentation counts the undetected tail in base R, and beats a Chao estimator.

May 23, 2026
Multi-species occupancy models
ecology tutorial
R
occupancy
hierarchical models
Bayesian statistics
MCMC
community ecology

Fit a community (multi-species) occupancy model in base R with a hand-coded Gibbs sampler, and watch partial pooling stabilise sparse-species estimates.

May 22, 2026
Checking a dynamic occupancy model
occupancy
ecology tutorial
R
population dynamics

Test the fit of a dynamic occupancy model in base R with a parametric bootstrap, and catch the detection heterogeneity that leaves the estimates looking fine.

May 22, 2026
Occupancy turnover and equilibrium
occupancy
ecology tutorial
R
population dynamics

Read the trajectory, equilibrium and turnover from a fitted dynamic occupancy model in base R, and see why a trend under constant rates need not mean change.

May 22, 2026
Covariates in dynamic occupancy models
occupancy
ecology tutorial
R
population dynamics

Let colonisation, extinction and detection depend on covariates in base R, and watch a detection covariate leak into the state process when you leave it out.

May 22, 2026
Dynamic occupancy: colonisation and extinction
occupancy
ecology tutorial
R
population dynamics

Fit a multi-season occupancy model in base R with a forward likelihood, and see why naive year-to-year turnover confounds extinction with imperfect detection.

May 22, 2026
Checking multi-state models
R
capture-recapture
model checking
ecology tutorial

Reasonable estimates do not mean a model fits. A bootstrap goodness-of-fit test in base R exposes hidden memory a standard multi-state model quietly absorbs.

May 22, 2026
Multi-event models for uncertain states
R
capture-recapture
population dynamics
ecology tutorial

When the recorded state can be wrong, naive multi-state analysis mistakes error for movement. Multi-event models add an observation layer to recover them.

May 21, 2026
Estimating transition probabilities
R
capture-recapture
population dynamics
ecology tutorial

Movement between states is often the quantity of interest, but state-specific detection can masquerade as movement. A multi-state model separates the two.

May 21, 2026
Multi-state capture-recapture
R
capture-recapture
population dynamics
ecology tutorial

Fit an Arnason-Schwarz model by hand: state-specific survival, movement between states and state-specific detection, using a hidden Markov likelihood in base R.

May 21, 2026
Checking an integrated population model
R
population dynamics
capture-recapture
demography
ecology tutorial

An integrated model can hide a conflict between its data sets. How to check each component, and whether the sources agree, with a cross-source survival test.

May 21, 2026
Demographic and environmental variance in an IPM
R
population dynamics
capture-recapture
demography
ecology tutorial

Separating demographic from environmental variance in population growth with an integrated model, why it depends on abundance, and when it is identifiable.

May 21, 2026
Implicit information in integrated models
R
population dynamics
capture-recapture
demography
ecology tutorial

How an integrated model estimates a demographic rate it has no direct data for, how much each data set contributes, and why implicit estimates lean on it.

May 21, 2026
Integrated population models from scratch
R
population dynamics
capture-recapture
demography
ecology tutorial

Integrated population models in base R: joining counts, capture-recapture and productivity, and why counts alone cannot split survival from recruitment.

May 21, 2026
Detection covariates and checking in SCR
R
capture-recapture
spatial
model diagnostics
ecology tutorial

Add a trap-effort covariate to the SCR detection function in base R, and use a parametric-bootstrap goodness-of-fit that a constant-detection model fails.

May 20, 2026
SCR sampling design and precision
R
capture-recapture
spatial
study design
ecology tutorial

How trap spacing relative to sigma controls spatial recaptures and the precision of density in spatial capture-recapture, worked from scratch in base R.

May 20, 2026
Bayesian spatial capture-recapture
R
capture-recapture
spatial
Bayesian statistics
MCMC
ecology tutorial

Bayesian SCR in base R by parameter-expanded data augmentation: a from-scratch sampler for latent activity centres, and posteriors for density and abundance.

May 20, 2026
Spatial capture-recapture from scratch
R
capture-recapture
spatial
abundance
ecology tutorial

Spatial capture-recapture in base R: a from-scratch SCR likelihood with latent activity centres, and why a non-spatial estimate cannot give you a density.

May 20, 2026
Bayesian closed capture-recapture
Bayesian statistics
MCMC
capture-recapture
R
ecology tutorial

Estimate closed-population size in R with parameter-expanded data augmentation: inclusion indicators, Gibbs updates, and a posterior for the animals never seen.

May 20, 2026
Bayesian state-space movement
Bayesian statistics
MCMC
movement ecology
R
ecology tutorial

Recover a latent movement path from noisy positions in R: forward-filter backward-sample, Gibbs updates, and the process-versus-observation noise trade-off.

May 20, 2026
Bayesian N-mixture abundance
Bayesian statistics
MCMC
abundance
R
ecology tutorial

Fit a Bayesian N-mixture model by hand in R: latent abundance data augmentation, Gibbs updates, and total abundance the naive maximum count underestimates.

May 19, 2026
Bayesian Cormack-Jolly-Seber survival
Bayesian statistics
MCMC
survival analysis
R
ecology tutorial

Fit an open-population Cormack-Jolly-Seber model by hand in R: latent alive-state data augmentation, Gibbs updates, and honest posterior credible intervals.

May 19, 2026
Bayesian occupancy with latent-state MCMC
R
Bayesian statistics
MCMC
occupancy
ecology tutorial

Fit a single-season occupancy model from scratch in base R with a Gibbs sampler and data augmentation, so imperfect detection stops hiding a present species.

May 19, 2026
Bayesian logistic regression under separation
R
Bayesian statistics
MCMC
logistic regression
ecology tutorial

When a predictor perfectly separates presence from absence the logistic MLE diverges. A weakly-informative Cauchy prior fixes it, coded from scratch in base R.

May 19, 2026
Choosing priors: flat is not uninformative
R
Bayesian statistics
priors
MCMC
ecology tutorial

Why vague priors can be strongly informative, in base R: flat logit priors on occupancy probability and the variance-prior trap in a hierarchical model.

May 19, 2026
Bayesian model comparison: WAIC, LOO, DIC
R
Bayesian statistics
MCMC
model selection
ecology tutorial

Comparing Bayesian models for ecological count data in base R: coding WAIC, PSIS-LOO with the Pareto-k check and DIC from posterior draws, from scratch.

May 19, 2026
Bayesian hierarchical models with MCMC
Bayesian statistics
MCMC
mixed models
R
ecology tutorial

Fit a varying-intercept Poisson model for site counts by Metropolis-within-Gibbs in base R, and see how partial pooling stabilises the data-poor sites.

May 19, 2026
MCMC convergence diagnostics from scratch
Bayesian statistics
MCMC
model diagnostics
R
ecology tutorial

Code the Gelman-Rubin R-hat and effective sample size by hand in R, and watch a single chain that looks perfectly converged miss half of a bimodal posterior.

May 18, 2026
Gibbs sampling with conjugate updates
Bayesian statistics
MCMC
R
ecology tutorial

Build a Gibbs sampler in base R for the mean and variance of a trait, and see why the mean’s posterior is a t distribution rather than a narrow normal.

May 18, 2026
Metropolis-Hastings from scratch
Bayesian statistics
MCMC
R
survival
ecology tutorial

Code a random-walk Metropolis sampler by hand in R to estimate a survival probability, and see why the posterior beats a Wald interval that dips below zero.

May 18, 2026
Validating a step selection model
movement ecology
habitat selection
model diagnostics
R
ecology tutorial

Used-habitat calibration plots from scratch: simulate used locations from a fitted step selection model and check if it reproduces the chosen habitat.

May 18, 2026
Availability sampling for step selection
movement ecology
habitat selection
R
ecology tutorial

How many available steps per used step, and from which distribution: extra steps buy precision in R, and the tentative kernel is a choice worth checking.

May 18, 2026
Integrated step selection analysis in R
movement ecology
habitat selection
R
ecology tutorial

Integrated step selection analysis from scratch: add movement covariates to a conditional model to debias habitat selection and recover the movement kernel.

May 18, 2026
Step selection functions for animal movement
movement ecology
habitat selection
R
ecology tutorial

Fit step selection functions in R from scratch: matched steps, a conditional logistic likelihood by hand, and why pooling strata attenuates selection.

May 17, 2026
Checking a state-space movement model
movement ecology
state-space models
model diagnostics
R
ecology tutorial

Check a fitted state-space movement model with one-step-ahead residuals in base R: QQ plots and autocorrelation reveal what a misspecified model quietly hides.

May 17, 2026
A particle filter for animal movement
movement ecology
state-space models
particle filter
Bayesian statistics
R
ecology tutorial

Build a bootstrap particle filter from scratch in base R for animal tracks with heavy-tailed Argos errors that drag a Gaussian Kalman filter off course.

May 17, 2026
Regularising irregular animal tracks
movement ecology
state-space models
Kalman filter
R
ecology tutorial

Turn gappy, irregular animal tracks into a regular series with a continuous-time integrated random walk and Kalman smoother in base R, with honest gap error.

May 17, 2026
State-space models for animal movement
movement ecology
state-space models
Kalman filter
time series
R
ecology tutorial

Fit a linear-Gaussian correlated random walk to noisy telemetry in base R: a hand-coded Kalman filter and smoother that split movement from observation error.

May 17, 2026
Checking a movement HMM
ecology tutorial
movement ecology
hidden Markov models

Two checks a fitted movement HMM needs: forecast pseudo-residuals to test the model, and forward-backward posterior probabilities for what Viterbi hides.

May 17, 2026
Covariates in a movement HMM
ecology tutorial
movement ecology
hidden Markov models

Let HMM transition probabilities depend on time of day through a multinomial logit, recover a diurnal activity budget, and see what a homogeneous model hides.

May 17, 2026
How many states in a movement HMM?
ecology tutorial
movement ecology
hidden Markov models

Choose how many states a movement HMM needs without overfitting: AIC and BIC across candidate models, why an extra state splits a real one, and label switching.

May 16, 2026
Fitting a two-state movement HMM in R
ecology tutorial
movement ecology
hidden Markov models

Build a two-state movement HMM from scratch in base R: gamma step lengths, von Mises turning angles, the forward algorithm, and Viterbi state decoding.

May 16, 2026
Life expectancy and passage time in an IPM
population dynamics
demography
integral projection models
R
ecology tutorial

Individual demography from an integral projection model in R: life expectancy and first-passage time from the fundamental matrix, against a naive estimate.

May 16, 2026
IPM sensitivity and elasticity
population dynamics
demography
integral projection models
R
ecology tutorial

Sensitivity and elasticity of an integral projection kernel in R: the continuous analogue of matrix perturbation analysis, split between survival and fecundity.

May 16, 2026
Eviction and mesh size in an IPM
population dynamics
demography
integral projection models
R
ecology tutorial

Two numerical traps in integral projection models: eviction of mass off the size boundary, and mesh size. See how each biases lambda in R, and how to fix them.

May 16, 2026
Building an integral projection model
population dynamics
demography
integral projection models
R
ecology tutorial

Build an integral projection model in R from survival, growth and fecundity regressions: assemble the kernel by the midpoint rule and read lambda from eigen.

May 16, 2026
Correlated random walks and net displacement
R
movement ecology
random walk
simulation
ecology tutorial

Simulate correlated, bounded and directed random walks in R, and use net squared displacement to tell ranging apart from a bounded home range or a migration.

May 15, 2026
Resource selection functions in R
R
GLM
resource selection
movement ecology
ecology tutorial

Fit a resource selection function in R with used-available logistic regression, see why selection ratios confound covariates, and why an RSF is relative.

May 15, 2026
Step lengths and turning angles in R
R
MASS
movement ecology
telemetry
ecology tutorial

Turn an animal track into step lengths and turning angles in R, fit the distributions, and see why path length and tortuosity depend on the fix interval.

May 15, 2026
Home ranges in R: MCP versus kernel density
R
MASS
home range
movement ecology
ecology tutorial

Estimate animal home ranges in R with minimum convex polygons and kernel density. Why the 100% MCP inflates with sample size and how bandwidth drives the KDE.

May 15, 2026
The theta-logistic model in R
R
population dynamics
time series
density dependence
maximum likelihood
ecology tutorial

Fitting the theta-logistic population growth model in R by maximum likelihood, and why the shape parameter theta is barely identifiable from one time series.

May 15, 2026
Estimating population trends in R
R
population dynamics
time series
GAMs
mgcv
ecology tutorial

Why one linear rate can hide a population crash and recovery, using a GAM in R to show trend shape, and why count data need a count model rather than log-OLS.

May 15, 2026
Gompertz state-space model in R
R
population dynamics
time series
state-space models
density dependence
ecology tutorial

Separating process noise from observation error in a population time series with a Gompertz state-space model in R, fitted by a hand-coded Kalman filter.

May 15, 2026
Detecting density dependence in R
R
population dynamics
time series
density dependence
ecology tutorial

Fitting a Gompertz model to a population time series in R, why the ordinary regression test for density dependence over-rejects, and the bootstrap fix.

May 14, 2026
Cormack-Jolly-Seber survival models in R
R
survival analysis
capture-recapture
ecology tutorial

Estimate apparent survival and recapture from open capture histories in R: build the m-array and fit a Cormack-Jolly-Seber model by maximum likelihood.

May 14, 2026
Nest survival with logistic exposure in R
R
survival analysis
nest survival
ecology tutorial

Estimate daily nest survival in R with the logistic-exposure model, compare it against the Mayfield estimate, and let daily survival vary with nest age.

May 14, 2026
Cox proportional hazards and the PH assumption
R
survival analysis
model diagnostics
ecology tutorial

Fit a Cox proportional hazards model in R, read the hazard ratios, test the proportional-hazards assumption with Schoenfeld residuals, and stratify to fix it.

May 14, 2026
Kaplan-Meier survival curves and the log-rank test
R
survival analysis
demography
ecology tutorial

Fit Kaplan-Meier survival curves to right-censored ecological data in R, compare two groups with the log-rank test, and see why a naive mean misleads.

May 14, 2026
Life table response experiments (LTRE) in R
R
population dynamics
matrix models
LTRE
ecology tutorial

Decompose the difference in growth between two matrices into per-element contributions in R, and see why the biggest vital-rate change need not matter most.

May 14, 2026
Transient dynamics of population matrix models
R
population dynamics
matrix models
transient dynamics
ecology tutorial

Compute the transient indices of a stage-structured matrix in R: reactivity, amplification and the damping ratio, and see why the initial structure matters.

May 13, 2026
Population viability analysis and extinction risk
R
population dynamics
conservation
extinction
ecology tutorial

A count-based population viability analysis in R: estimate the mean and variance of log growth from monitoring counts, then project quasi-extinction risk.

May 13, 2026
Stochastic population growth in variable environments
R
population dynamics
matrix models
stochasticity
ecology tutorial

How environmental variation lowers the long-run growth of a structured population in R: stochastic lambda by simulation and the Tuljapurkar approximation.

May 13, 2026
Sensitivity and elasticity of matrix models
R
population dynamics
matrix models
conservation
ecology tutorial

Compute sensitivity and elasticity of a population matrix in R, verify the eigenvector formula numerically, and rank vital rates for conservation action.

May 13, 2026
Stage-structured Lefkovitch matrices in R
R
population dynamics
matrix models
stage structure
ecology tutorial

Build a stage-classified Lefkovitch matrix in R for a plant with variable stage durations, and see why the diagonal stasis term is not optional bookkeeping.

May 13, 2026
Leslie matrix population models in R
R
population dynamics
demography
matrix models
ecology tutorial

Turn a life table into a Leslie matrix in R and read growth rate, stable age distribution and reproductive value from its dominant eigenvalue and eigenvectors.

May 13, 2026
Life tables and population growth in R
R
population dynamics
demography
life tables
ecology tutorial

Build a cohort life table in R and turn age-specific survival and fecundity into R0, generation time and the growth rate lambda via the Euler-Lotka equation.

May 13, 2026
Modelling inhomogeneous point patterns in R
R
spatial
point patterns
ecology tutorial

Fit an inhomogeneous Poisson process in base R: kernel intensity, a trend via Poisson GLM, and the inhomogeneous K that separates trend from interaction.

May 12, 2026
Ripley’s K and the pair correlation function
R
spatial
point patterns
ecology tutorial

Estimate Ripley’s K, the L transform and the pair correlation function in base R, with translation edge correction and Monte Carlo simulation envelopes.

May 12, 2026
Nearest-neighbour analysis and Clark-Evans in R
R
spatial
point patterns
ecology tutorial

Measure nearest-neighbour distances in base R: the Clark-Evans index with edge correction, plus the G and F distance functions for aggregation and spacing.

May 12, 2026
Complete spatial randomness and quadrat tests in R
R
spatial
point patterns
ecology tutorial

Simulate random, clustered and regular point patterns in base R, then test complete spatial randomness with quadrat counts and the variance-to-mean ratio.

May 12, 2026
Distance sampling for density in R
R
abundance
detection
ecology tutorial

Estimate animal density from line-transect surveys when detection falls with distance. Fit half-normal and hazard-rate detection functions from scratch in R.

May 12, 2026
Closed-population capture-recapture in R
R
abundance
detection
ecology tutorial

Estimate the size of a closed population from repeated capture occasions. Fit Lincoln-Petersen, Schnabel and the model M0 likelihood from scratch in R.

May 12, 2026
Removal and depletion sampling in R
R
abundance
detection
ecology tutorial

Estimate closed-population size from a declining series of removal catches. Fit the Zippin removal model and the Leslie-DeLury depletion regression in R.

May 12, 2026
N-mixture models for abundance in R
R
abundance
detection
N-mixture
ecology tutorial

Estimate animal abundance from repeated counts while accounting for imperfect detection. Fit a binomial N-mixture model from scratch in R with base optim.

May 11, 2026
How many visits? Occupancy survey design
R
occupancy
experimental design
statistical power
ecology tutorial

Decide how many repeat visits an occupancy survey needs, from cumulative detection to the sites-versus-visits trade-off under a fixed budget, worked in R.

May 11, 2026
Occupancy and detection covariates in R
R
occupancy
GLM
prediction
ecology tutorial

Let occupancy depend on habitat and detection on survey effort in a single-season occupancy model, then predict occupancy with confidence bands in base R.

May 11, 2026
Fitting single-season occupancy models in R
R
occupancy
maximum likelihood
detection probability
ecology tutorial

Build the MacKenzie occupancy likelihood from scratch and fit it with optim to separate true site occupancy from detection probability, using base R only.

May 11, 2026
Imperfect detection and occupancy bias in R
R
occupancy
detection probability
GLM
ecology tutorial

Why counting the sites where a species was seen underestimates true occupancy, and how the detection gap grows with fewer survey visits, worked through in R.

May 11, 2026
Spatial cross-validation for SDMs in R
R
SDM
cross-validation
spatial autocorrelation
mgcv
ecology tutorial

Why random cross-validation overstates SDM accuracy when occurrences cluster in space, and how spatial block cross-validation gives an honest estimate, in R.

May 11, 2026
Evaluating species distribution models in R
R
SDM
model evaluation
ROC
ecology tutorial

Test an SDM in R against held-out data: the ROC curve and AUC, a confusion matrix with sensitivity, specificity and TSS, and how to pick a good threshold.

May 10, 2026
Pseudo-absence and background points for SDMs
R
terra
SDM
sampling
ecology tutorial

How many background points an SDM needs, why predicted values are relative rather than probabilities, and how case weights stabilise the scale, worked in R.

May 10, 2026
Species distribution modelling with GLM in R
R
terra
sf
SDM
GLM
ecology tutorial

Fit a species distribution model in R with a binomial GLM: draw presence and background points, model humped responses, and map predicted habitat suitability.

May 10, 2026
Ancestral state reconstruction in R
R
ape
phylogenetics
comparative methods
ecology tutorial

Ancestral state reconstruction in R with ape: fitting continuous and discrete trait models with ace, reading node uncertainty, and when not to trust it.

May 10, 2026
Phylogenetic generalised least squares
R
ape
nlme
phylogenetics
comparative methods
ecology tutorial

PGLS in R with ape and nlme: why ordinary regression across related species inflates false positives, and how corBrownian and corPagel fix the problem.

May 10, 2026
Independent contrasts: Felsenstein’s method
R
ape
nlme
phylogenetics
comparative methods
ecology tutorial

Phylogenetic independent contrasts in R with ape: turn correlated species data into independent points, regress through the origin, and check branch lengths.

May 10, 2026
Phylogenetic signal: Blomberg’s K and Pagel’s lambda
R
ape
nlme
phylogenetics
comparative methods
ecology tutorial

Measure phylogenetic signal in species traits with Blomberg’s K and Pagel’s lambda in R: fit both indices, test them against a null, and read the outcome.

May 10, 2026
Cleaning GBIF and iNaturalist records in R
R
sf
data cleaning
GBIF
ecology tutorial

Occurrence records from GBIF and iNaturalist need cleaning. In R: drop impossible and duplicate coordinates, flag low precision, and map the result with sf.

May 9, 2026
Species-area relationships in R
ecology tutorial
R
biogeography
species richness
regression
community ecology

Fit species-area relationships in R: the power law and the logarithmic model, why the power exponent z matters, and how nls differs from log-log regression.

May 9, 2026
Additive diversity partitioning in R
ecology tutorial
R
vegan
beta diversity
community ecology
Hill numbers

Split gamma diversity into alpha and beta additively in R with vegan adipart, test it with a null model, and see why Hill numbers matter for diversity indices.

May 9, 2026
Nestedness, NODF, and null models in R
ecology tutorial
R
vegan
nestedness
null models
community ecology
beta diversity

Measure community nestedness with the NODF metric in R using vegan, then test it with fixed-margin null models and see why the null choice decides the verdict.

May 9, 2026
Distance decay of community similarity in R
ecology tutorial
R
vegan
beta diversity
biogeography
spatial ecology

Community similarity falls with geographic distance. Fit the negative-exponential decay in R, read the halving distance, and test it with a Mantel permutation.

May 9, 2026
Marginal vs conditional R-squared in mixed models
mixed models
R
nlme
model evaluation
ecology tutorial

A mixed model has two R-squared values: marginal for the fixed effects, conditional for fixed plus random. Compute both by hand in R from an nlme model.

May 9, 2026
Modelling non-constant variance with nlme
regression
R
nlme
model diagnostics
ecology tutorial

Unequal residual spread breaks the constant-variance assumption and skews standard errors. Model heteroscedasticity in R with nlme varIdent and varPower.

May 8, 2026
Repeated measures and temporal correlation in R
mixed models
R
nlme
time series
ecology tutorial

Measuring the same plots over time creates correlated residuals. Ignoring temporal autocorrelation inflates false positives; model it with corAR1 in nlme.

May 8, 2026
Random slopes in mixed models with nlme
mixed models
R
nlme
regression
ecology tutorial

When the effect of a predictor varies between sites, random intercepts are not enough. Fit and interpret random slopes in R with nlme, including shrinkage.

May 8, 2026
Marginal means and contrasts after a GLM
GLM
contrasts
multiple comparisons
ecology tutorial

After a GLM, marginal means and pairwise contrasts answer what the coefficient table cannot. Build them from the model matrix, then adjust for multiplicity.

May 8, 2026
Interaction terms in ecological GLMs
GLM
interactions
count data
ecology tutorial

Interaction terms in count GLMs set how one predictor bends another’s slope. Read them through predictions, centre variables, and check the link scale.

May 8, 2026
From GLM coefficients to predicted values in R
GLM
prediction
count data
logistic regression
ecology tutorial

Turn count and logistic GLM coefficients into predictions in R: build the confidence band on the link scale, back-transform it, and read the effect correctly.

May 8, 2026
Pseudoreplication and false positives in ecology
R
mixed models
experimental design
ecology tutorial

Treating repeated measurements as independent replicates inflates false positives. A simulation shows the cost, and how aggregating or a mixed model fixes it.

May 8, 2026
Four common PERMANOVA mistakes in ecology
R
vegan
multivariate
PERMANOVA
ecology tutorial

A significant PERMANOVA can really be unequal dispersion. Check betadisper, pick the right dissimilarity, respect your design, and read adonis2 honestly.

May 7, 2026
Offsets for rates and densities in Poisson GLMs
R
GLM
count data
ecology tutorial

Sampling effort varies between sites and distorts raw counts. Add a log-effort offset to a Poisson GLM to model rates and densities, and recover the truth.

May 7, 2026
Collinearity and VIF in ecological regression
R
regression
model diagnostics
ecology tutorial

Correlated predictors inflate standard errors and destabilise coefficients in ecological regression. Compute the VIF by hand in R, read it, and act on it.

May 7, 2026
A reproducible statistical workflow in R
reproducibility
workflow
ecology tutorial
R

Making an ecological analysis reproducible in R: seeding random steps, recording package versions, using relative paths, and rendering from a clean session.

May 7, 2026
When not to use the Shannon diversity index
diversity
ecology tutorial
vegan
R

The Shannon index blends richness and evenness into one number, which can mislead. See when Hill numbers, evenness or richness tell a clearer ecological story.

May 7, 2026
Bootstrap confidence intervals in R
statistics
bootstrap
ecology tutorial
R

Bootstrap confidence intervals in R when no formula applies: percentile and BCa methods on a Shannon index and a regression slope, and where it breaks.

May 7, 2026
Standard errors and confidence intervals in R
statistics
uncertainty
ecology tutorial
R

What a standard error and a 95% confidence interval mean in R, how they differ from the standard deviation, and how to check interval coverage by simulation.

May 6, 2026
Generalised least squares for spatial data in R
R
GLS
spatial
regression
ecology tutorial

When regression residuals are spatially autocorrelated, OLS standard errors mislead. Fit a GLS model in nlme, pick a correlation structure by AIC, and compare.

May 6, 2026
Contrasts and post-hoc comparisons in R
R
linear models
ANOVA
multiple comparisons
ecology tutorial

After a significant ANOVA, which groups differ? Treatment versus sum coding, planned and trend contrasts, Tukey HSD, and correcting pairwise tests, all in R.

May 6, 2026
t-tests and ANOVA as linear models in R
R
linear models
ANOVA
regression
ecology tutorial

A t-test and a one-way ANOVA are the same linear model. Fit both in R on grassland data, read treatment-coded coefficients, and see why F equals t squared.

May 6, 2026
Power analysis by simulation in R
R
experimental design
power analysis
simulation
statistics
ecology tutorial

Run a power analysis by simulation in R: build a power curve over sample size, check the Type-I rate, and see why post-hoc power and low-power studies mislead.

May 6, 2026
GLM residual diagnostics with simulation in R
R
GLM
model diagnostics
count data
statistics
ecology tutorial

Why Pearson and deviance residuals mislead for GLMs, and how to build simulation-based quantile residuals in R to spot overdispersion and zero-inflation.

May 6, 2026
Model selection with AIC in R for ecology
R
model selection
AIC
regression
statistics
ecology tutorial

Compare candidate models in R with AIC, AICc and BIC: read delta values, weigh models with Akaike weights and evidence ratios, then average their predictions.

May 6, 2026
PCA for environmental data: scaling and axes
ordination
multivariate
vegan
R
ecology tutorial

Run PCA on environmental data in R: why to standardise variables, how the broken-stick rule chooses axes, and reading scaling 1 versus scaling 2 biplots.

May 5, 2026
Logistic regression for presence-absence data
regression
GLM
species distribution
R
ecology tutorial

Model species presence and absence with a binomial GLM in R: reading log-odds and odds ratios, fitting proportion data, and spotting the separation trap.

May 5, 2026
Choosing a dissimilarity index for community data
community ecology
multivariate
vegan
R
ecology tutorial

Euclidean, Bray-Curtis, Jaccard or Hellinger: how the dissimilarity index you choose reshapes ordination of community data in R, and why double zeros matter.

May 5, 2026
Phylogenetic diversity in R: PD, MPD, MNTD
R
community ecology
biodiversity
picante
ecology tutorial

Phylogenetic community structure in R with picante: Faith’s PD, mean pairwise distance (MPD), nearest taxon distance (MNTD), and the NRI and NTI effect sizes.

May 5, 2026
Species co-occurrence null models in R
R
community ecology
biodiversity
vegan
ecology tutorial

Test for non-random species co-occurrence in R with vegan: the C-score, oecosimu, the fixed-fixed (quasiswap) null model, and standardised effect sizes.

May 5, 2026
Fitting species abundance distributions in R
R
community ecology
biodiversity
vegan
ecology tutorial

Fit and compare rank-abundance models in R with vegan radfit: pre-emption, lognormal, Zipf and Zipf-Mandelbrot, with AIC selection and Preston octave plots.

May 5, 2026
Functional diversity in R with the FD package
R
functional diversity
traits
diversity
ecology tutorial

Measure functional diversity in R from mixed traits with the FD package: Gower distance, functional richness, evenness, divergence, and Rao’s quadratic entropy.

May 4, 2026
From scattered plots to a surface: IDW and kriging in R
R
spatial
geostatistics
interpolation
ecology tutorial

Turn sparse point measurements into a continuous map in R: the empirical variogram, inverse distance weighting, and ordinary kriging with gstat and sf.

May 4, 2026
Zero-inflated and hurdle models for ecological counts
R
GLM
count data
zero inflation
ecology tutorial

Excess zeros in ecological counts: telling overdispersion from zero inflation, then fitting zero-inflated negative binomial and hurdle models in R with pscl.

May 4, 2026
Exporting publication-quality ggplot figures in R
R
data visualisation
ggplot2
workflow
ecology tutorial

Save ggplot2 figures that meet journal rules: setting physical size and resolution, choosing PNG, TIFF, PDF or SVG, and embedding fonts so your text survives.

May 4, 2026
Pseudoreplication: GLMMs for nested counts in R
R
mixed models
GLMM
count data
lme4
ecology tutorial

Why nesting plots within sites breaks a Poisson GLM’s independence, how a random intercept fixes it, and what intraclass correlation and partial pooling mean.

May 4, 2026
RDA vs CCA for community ecology: by gradient length
R
ordination
constrained ordination
community ecology
vegan
ecology tutorial

Redundancy analysis versus canonical correspondence analysis on community data: what the DCA gradient-length rule can settle, and where Hellinger fits.

May 4, 2026
From QGIS to R: a spatial join with GeoPackage
R
QGIS
sf
spatial
GeoPackage
ecology tutorial

Load occurrence points in QGIS, tag each with the habitat patch it falls in by a spatial join, export to GeoPackage, and continue the analysis in R with sf.

May 4, 2026
Spatial autocorrelation and Moran’s I in R
R
spatial
spdep
regression
ecology tutorial

Nearby sites resemble each other, breaking the independence regression assumes. Moran’s I measures it, a correlogram shows its scale, a residual test finds it.

May 3, 2026
capscale vs dbrda: same axes, different test
R
ordination
vegan
multivariate
ecology tutorial

vegan has two functions for distance-based constrained ordination. On Bray-Curtis they return the same axes but a different pseudo-F: the negative eigenvalues.

May 3, 2026
Modelling nonlinear species responses with GAMs
R
regression
GAMs
mgcv
ecology tutorial

A count GLM forces a single direction of response. When a species peaks at an intermediate optimum, a generalised additive model lets the data choose the shape.

May 3, 2026
Raster data in R with terra: DEMs and extraction
R
spatial
raster data
ecology tutorial

What a raster really is, how to read its structure, map algebra and slope from an elevation model, what coarsening the grain does, and pulling values at points.

May 3, 2026
Poisson and negative binomial GLMs in R
R
regression
count data
ecology tutorial

Why logging abundance counts is a poor reflex, how to fit a Poisson GLM, how to tell it is too tight, and how a negative binomial and an effort offset fix it.

May 3, 2026
Mantel tests in R: correlating distance matrices
R
multivariate
spatial statistics
ecology tutorial

Simple and partial Mantel tests with vegan, what they really test, and why a spatially structured environment can make geography look important when it is not.

May 3, 2026
ordisurf vs envfit: nonlinear gradients in R
R
ordination
gradient analysis
vegan
ecology tutorial

envfit draws one straight arrow assuming a single direction of increase; for a humped variable it points nowhere. Fit a smooth GAM surface with ordisurf in R.

May 2, 2026
Variation partitioning in R: environment vs space
R
multivariate
ordination
vegan
ecology tutorial

When predictors overlap, R-squared double-counts shared structure. Split community variation into environment, space and the shared fraction with varpart in R.

May 2, 2026
Pairwise PERMANOVA in R: which groups differ
R
multivariate
hypothesis testing
vegan
ecology tutorial

A significant PERMANOVA says groups differ somewhere, not which pairs. Run pairwise adonis2 in R, correct for multiple tests, and check dispersion first.

May 2, 2026
Hierarchical clustering and dendrograms in R
R
community ecology
ordination
ecology tutorial

Turn a dissimilarity matrix into groups with hclust: a dendrogram, a linkage choice, a cut into clusters, and what that cut can and cannot prove about them.

May 2, 2026
Rarefaction and accumulation curves in R
R
community ecology
diversity
ecology tutorial

More individuals and more plots both raise the species count, whatever the true richness. Rarefaction and accumulation curves separate diversity from effort.

May 2, 2026
Indicator species analysis with IndVal in R
R
community ecology
indicator species
ecology tutorial

PERMANOVA says groups differ; indicator species analysis says which species drive it. A walk through multipatt, the IndVal index, specificity and fidelity.

May 2, 2026
Beta diversity in R: turnover vs nestedness (betapart)
R
community ecology
beta diversity
ecology tutorial

A single dissimilarity number hides two processes: species replacement and species loss. Separate them in R with the betapart package and the Baselga framework.

May 2, 2026
Constrained ordination with distance-based RDA in R
R
vegan
ordination
constrained ordination
community ecology
ecology tutorial

NMDS shows all compositional variation and overlays environment afterward; distance-based RDA builds the ordination from predictors and tests what they explain.

May 1, 2026
Mapping species richness in R with sf
R
sf
spatial
GIS
mapping
ecology tutorial

Turn species occurrence records into a gridded richness map in R with the sf package, then export a GeoPackage you can open and style further in QGIS.

May 1, 2026
Statistics on an ordination: envfit and PERMANOVA in R
R
vegan
ordination
PERMANOVA
community ecology
ecology tutorial

An NMDS shows the pattern. Use envfit to fit environmental variables onto it, adonis2 to test whether groups differ, and betadisper to keep the test honest.

May 1, 2026
Ordination with NMDS in R
R
vegan
ordination
community ecology
ecology tutorial

Turn a site-by-species table into a map of community composition with vegdist and metaMDS, then read the stress and decide how many dimensions you need.

May 1, 2026
Computing diversity indices in R with vegan
R
biodiversity
ecology tutorial

Compute species richness, Shannon and Simpson diversity from a site-by-species community matrix in R with vegan, with reusable code and a small worked example.

May 1, 2026
Welcome to Tidy Ecology
meta

What Tidy Ecology is and who it is for: reproducible R and QGIS workflows for ecology, from diversity and ordination to spatial analysis and species models.

May 1, 2026
No matching items

    Newsletter

    Get new tutorials by email

    New R and QGIS tutorials for ecologists, straight to your inbox. No spam; unsubscribe anytime.

    By subscribing you agree to receive these emails and confirm your address once. See the privacy policy.

    ESC

    Type to search 696 tutorials

      © 2026 Tidy Ecology

      • About

      • Disclaimer

      • Privacy

      • Terms

      • DMCA

      • R-bloggers