Re-checks, on demand, that an aniframe's metadata still describes the
frame it is attached to. The two drift apart silently under ordinary
dplyr work: dplyr::select() drops a column without touching the
metadata that names it, and assignment can change a column's type. The
invariants are therefore checked rather than assumed:
Details
the index column is present and numeric — hard error;
every column named in
variables_what,variables_when,variables_whereandvariables_eventis present in the data — hard error;every column named in
variables_whereis numeric — hard error;coordinate_systemagrees withvariables_where— warning only. The frame is still usable, and the field is derived rather than declared, so it can be refreshed;identity, temporal context and the index together name one observation per row — warning only (#49);
a declared
sampling_rateagrees with the spacing of the index — warning only (#114).
See also
ensure_is_spatial() for the spatial subset of these checks,
which is the part downstream filters need on every call;
validate_anievent() for the anievent equivalent.
Examples
af <- aniframe(time = 1:5, x = 1:5, y = 1:5)
validate_aniframe(af)