mescla.prep.missing

Ragged datasets: reporting, and choosing what to keep.

Real hydrochemical datasets are not rectangular. Species are added to and dropped from a monitoring programme, laboratories change, and a campaign that analysed twenty determinands in one year analysed eleven in the next – Tubau et al. (2014) note exactly this of their river record.

Dropping every incomplete sample is the usual reflex and it is often the wrong trade: one rarely measured species can cost you most of your samples. The tools here make that trade explicit so you can choose it rather than stumble into it.

Functions

complete_species

Keep the species present in at least min_fraction of samples.

drop_incomplete_samples

Keep only the samples with every species present.

impute_below_detection

Replace non-detects by factor times their detection limit.

largest_complete_block

Find the complete sub-matrix retaining the most data.

missing_summary

Per-species count of missing analyses, and what dropping each would cost.