Skip to contents

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:

Usage

validate_aniframe(data)

Arguments

data

An aniframe object.

Value

The input data, invisibly.

Details

  • the index column is present and numeric — hard error;

  • every column named in variables_what, variables_when, variables_where and variables_event is present in the data — hard error;

  • every column named in variables_where is numeric — hard error;

  • coordinate_system agrees with variables_wherewarning 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_rate agrees 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)