Defines a complete movement task schema including events, phases, normalization method, metrics, and visualization defaults.
Arguments
- task_type
Short identifier for the task type (e.g., "gait", "jump")
- task_label
Human-readable label (e.g., "Gait Cycle", "Vertical Jump")
- events
List of Event objects defining key timepoints
- phases
List of Phase objects defining movement phases
- normalization
Normalization method:
"cycle" - Normalize entire movement to 0-100%
"phase" - Normalize each phase independently to 0-100%
"landmark" - Align to a specific event
"dtw" - Dynamic time warping alignment
"absolute" - Keep original time (no normalization)
- norm_length
Target length after normalization (default 101 for 0-100%)
- metrics
Character vector of recommended metrics for this task
- vis_defaults
List of default visualization parameters:
xlab - X-axis label
ylab - Y-axis label
show_phases - Whether to show phase regions
show_events - Whether to show event markers
phase_alpha - Transparency for phase shading
landmark_event - Event to align to (for landmark normalization)
Examples
# Simple task schema
my_task <- TaskSchema(
task_type = "simple",
task_label = "Simple Movement",
events = list(
Event("start", "Start", "threshold",
list(signal = "velocity", threshold = 0.1, direction = "rising")),
Event("end", "End", "threshold",
list(signal = "velocity", threshold = 0.1, direction = "falling"))
),
phases = list(
Phase("main", "Main Phase", "start", "end")
),
normalization = "cycle"
)