Returns a list containing the default metadata fields and their initial
values. The same metadata substrate is shared by both aniframe() and
anievent() objects; per-class data contracts are versioned via
spec_version. Most fields are initialized as NA and should be set
appropriately for your data.
Value
A named list with the following fields:
source: Data source identifier (character, NA)source_version: Version of the data source (character, NA)filename: Original filename(s) (character vector, NA). Accepts a vector of length 1 or more — readers that load from multiple files (e.g.aniread::read_trackball()) populate this with all source paths.sampling_rate: Sampling rate in Hz (numeric, NA). Declared, not derived — set it withset_sampling_rate().sampling_interval: The interval between consecutive observations (numeric, NA), in the unit the index is in. Derived from the index at construction and refreshed on every re-declaration, so it describes the data rather than a claim about it. Read it withget_sampling_interval(); ask whether the spacing is even withis_sampling_regular(), which is computed on demand because dropping rows changes the answer.start_datetime: Start date and time of recording (POSIXct, NA)variables_index: The single column the frame is indexed by (character,"time"). Exactly one column, and it may be called anything — the constructor requires that column rather than a column literally namedtime. It is never one of thevariables_when, which holds the surrounding temporal context and is what the frame is grouped by; the index positions each row within its context and so is never a grouping variable. Read it withget_index(), change it withset_index(). Absent from objects serialised before the field existed, where it reads back as"time"— the value they were built with.variables_what,variables_when,variables_where: The columns that carry, respectively, entity identity, temporal context and spatial position. These are the structural fields —as_aniframe()uses them to coerce column types, order columns and rows, group the frame, and derivecoordinate_system. The values here are a placeholder skeleton for an object with no data attached; every constructor overwrites them from the data or from its arguments. In particularvariables_whatis not a requirement that a frame carryindividualandkeypointcolumns — the rule is that a frame has at least one identity variable, whichever it happens to be.axes: Which column carries which axis role (named character,c(x = "x", y = "y")). Names are roles —x,y,z,rho,phi,theta— and values are the columns carrying them, so a frame whose coordinates are called something else still has a usablecoordinate_system. The role set is closed, which is what keeps transformations between coordinate systems well defined; the column names are free. Empty when the roles are unknown. Read it withget_axes(), change it withset_axes().variables_wherenames the same columns without their roles, and is derived from this.reference_frame: Reference frame (factor, "allocentric"). Permitted values: "allocentric", "egocentric", "none".coordinate_system: Coordinate system (factor, "cartesian_2d")axis_directions: Which way each axis points, keyed by axis role (named character, empty). One of "right", "left", "up", "down", "back" or "forward", read from where the recording was made. Read it withget_axis_directions(), change it withset_axis_directions(), which reflects an axis turned over.get_angle_direction()andget_handedness()follow from it.axis_extents: How far each axis runs, keyed by axis role (named numeric, empty) — the video frame height fory. Read it withget_axis_extents(), change it withset_axis_extents(). It is what an axis is reflected around.handedness: Whether the frame is right- or left-handed (factor, "unknown"). Three declared axis directions determine it and are read in preference; the field carries the convention on its own for a frame that states one without spelling the axes out. Read it withget_handedness(), change it withset_handedness().
The spatial fields all have a way of saying "not applicable", because
the metadata substrate is shared with anievent(), which has no
spatial component at all: unit_space, unit_angle and
reference_frame take "none", coordinate_system takes "unknown", and
axes, axis_directions and axis_extents are empty. An anievent is
constructed with those values rather than inheriting movement defaults
it cannot honour (#73).
connections: Named list of connection tables, one per identity or temporal variable (typicallykeypointfor skeletons; could also beindividualfor social networks). Each entry is a 2-column tibble offrom/topairs. Default is an empty list. Manage viaset_connections(),get_connections(),add_connections()andremove_connections().variables_event: Named list with two entries,stateandpoint, each a character vector naming columns that carry per-frame categorical event labels.statecolumns are interval-valued (durative behaviours, ordered coarse to fine to encode nesting);pointcolumns are instantaneous (zero-duration events). Foundation for theanieventclass and downstream event-handling utilities. Default is an empty list for each.spec_version: Named list of semantic version strings, one per class in the animovement ecosystem (currentlyaniframeandanievent). Versions the full data contract of each class (mandatory columns, validator, and the metadata fields the class uses), independently of the package version. Objects serialised before this field existed are tolerated by the metadata validator; new objects always get it.
Examples
names(list_default_metadata())
#> [1] "source" "source_version" "filename"
#> [4] "sampling_rate" "sampling_interval" "start_datetime"
#> [7] "variables_index" "variables_what" "variables_when"
#> [10] "variables_where" "variables_event" "axes"
#> [13] "unit_space" "unit_angle" "unit_time"
#> [16] "reference_frame" "coordinate_system" "axis_directions"
#> [19] "axis_extents" "handedness" "connections"
#> [22] "spec_version"