Anotate MovementAnotate dataframes by adding movement related data/computations as columns |
|
|---|---|
Add angular difference wrt reference direction to movement or eye tracker data frame |
|
Add movement direction to movement data frame |
|
Add column with distance to stationary target |
|
Add column with distance to moving target |
|
Add target fixations to eyetracker data |
|
Add gaze elevation to (head) movement or eye tracker data frame |
|
Add column indicating if a stationary or moving target is in foveal view |
|
Add direction of the orientation of a reference object relative to a stationary target (in 2D, XZ). |
|
Add direction of the orientation of a reference object relative to a target movement (in 2D, XZ). |
|
Add rotation matrix to movement or eye tracker data frame |
|
Helper function that takes an eye tracker data frame and adds a new column |
|
Helper function that takes a movement data frame and adds a new column |
|
Add movement speed to movement data frame |
|
Add vector of a reference object relative to a stationary target |
|
Add gaze vector of a reference object relative to a target movement |
|
Extract MovementExtract common computations from data |
|
Extract at specific distance from a reference position, using any extract function |
|
Extract value of inner column at specified time |
|
Extract mean direction between a |
|
Extract net displacement between a |
|
Extract durations of discrete values in a movement tibble |
|
Extract ratio of target fixation between a |
|
Extract fruit picking between a |
|
Extracts the most frequent label in a time series tibble. |
|
Extract gaze elevation between a |
|
Extract (min, max or mean) 2D distance between movement trajectory and reference position. |
|
Extract (min, max or) 2D distance between two movement trajectories. |
|
Extract direction of the orientation of a reference object relative to a stationary target (in 2D, XZ) between a |
|
Extract direction of the orientation of a reference object relative to a target movement (in 2D, XZ) between a |
|
Extract 2D Path Length from Movement Data |
|
Extract pupil diameter statistics between a |
|
Extract recording duration of a movement tibble |
|
Extract value sequence of inner column between a |
|
Extract speed (peak or average speed) between a |
|
Extract angular speed (peak or average speed) for a direction vector between a |
|
Extract a timemask from a dataframe for use in extract_with_timemask |
|
Wrap extract_* functions with a mask on time. |
|
Extract number of time bins in a movement tibble |
|
Extract duplicated time stamps. |
|
Movement ProcessingGuess times; validate, prepare, resample or summarise movement data |
|
Average a list of resampled time series (movement, fruit collection or eyetracking) data frames |
|
Check whether movement data frame contains valid tracker information |
|
Combine and resample two movement data frames |
|
This function extracts one body point position data from a nested qualisys tibble, and converts it to a standalone movement tibble, which can be processed with standard vrthreat functions. Use |
|
Correct movement timing |
|
Get time of first fruit collection |
|
Get fruit appearance or collect time for the n-th fruit This function returns the exact time stamp of this fruit. |
|
Guess first time an object is in foveal view |
|
Guess start of escape |
|
Guess end of escape time |
|
Guess escape abortion position and time |
|
Guess First Move From Position |
|
Guess First or Last Move From or To Position |
|
Guess/interpolate position at a point in time |
|
Estimate actual threat speed from movement data |
|
Guess time at a distance between two movement data frames |
|
Find the temporal latency between two movement trajectories |
|
Prepare gaze data for further processing |
|
Reorient movement data by affine transformation |
|
Reorient movement data frame such that initial values match start position and orientation |
|
Reorient movement data from Qualisys to Unity |
|
Reorient movement data from Unity to Qualisys |
|
Resample an eyetracker data frame to new time index. |
|
Resample and median-filter position and rotation columns in a movement data frame |
|
Resample a fruit collection frame to new time index. |
|
Resample a movement data frame. |
|
Summarise movement data frame for each unique time stamp |
|
Translate positions in movement data frame to reference position. |
|
Label ProcessingManage label columns (i.e columns containing strings) in dataframes. |
|
Add n-grams to a tibble containing label data |
|
Clean labels |
|
Find all unique labels across trials |
|
Construct a label column from an existing one via a mapping. |
|
Merge by concatenating labels from different columns |
|
Reduce a tibble by replacing rows where a label is repeated consecutively with just the first row. |
|
Trial ProcessingManage trial data at a high level |
|
Apply replacements using replacement data frame. |
|
Average time series data columns within group |
|
Check movement data columns |
|
Correct movement timing across columns |
|
Create threat name column from episode name |
|
Fixes names in older versions of the output. Specifically, deletes the occurance of |
|
Get distribution of labels or similar categorical data across a trial results dataframe. |
|
Remove tutorial trials - i.e. episode either containing "Tutorial" or "Practice" |
|
Reorient movement data columns by affine transformation |
|
Reorient movement columns to starting position. |
|
Reorient movement data columns from Qualisys into Unity |
|
Resample eyetracker data columns |
|
Resample fruit task data columns |
|
Resample and relocate movement data columns |
|
Summarise movement data columns to ensure unique time stamps |
|
Translate movement cols as per reference column |
|
Proprocess a trial results tibble |
|
Scenario ProcessingExtract scenario related data from .json files |
|
Find fruit position |
|
Find initial threat position from programmatic scenario planner |
|
Find safe position |
|
Find scenario position |
|
Find Start marker position and rotation |
|
Find Unity's internal threat name |
|
Find weapon position |
|
Flatten a nested "scene json" list into a tidy data frame |
|
Get Time Of First Sequence Event |
|
Get Time Of First Sequence Event across multiple sequence columns |
|
Generate position list |
|
QuestionnaireManage quest data |
|
Read and score questionnaire data |
|
Read raw (csv) questionnaire data |
|
Replace Redcap id in questionnaires by VR ppid |
|
Get sum of a questionnaire subscale |
|
Get MSSQ subscale score (Motion Sickness; Golding, 2006) |
|
Get sum of a questionnaire if questionnaire exists |
|
Audio ProcessingHelp play and annotate sounds |
|
Automatically detect sounds in audio recording using a volume/duration threshold |
|
Automatically detect sounds across an entire data frame |
|
Get audio section |
|
Join a sound classification file into trial_results tibble |
|
Play audio recording from threat appearance to the end |
|
Play audio section |
|
Read manual sound detection file |
|
Manually classify sounds |
|
Manually detect sounds |
|
Write audio section |
|
IO functionsSave figures and read data from Unity, Json, CSV into R. |
|
Clean Scenario Data Column |
|
Create output folders under an experiment name |
|
Load and Optionally Clean Trial Results |
|
Join CSV Files to Trial Results |
|
Read CSV Files |
|
Read JSON Files |
|
Read log messages |
|
Read and Join Weapon Log Messages |
|
Read participant details from files |
|
Read complete study data |
|
Read Trial Results |
|
Remove study path from file path |
|
Remove top-level directory in a full file path. |
|
Wrapper around |
|
Split a path name into into its components |
|
Standardise file path |
|
Update file pointers |
|
Data InterfacingInterface with STAN |
|
Convert 1-3 dimensional array to STAN format |
|
MathsMathematical helper functions |
|
This uses R base functions to calculate the angle between two vectors in degrees, accounting for rounding errors to avoid NaNs. |
|
Calculate angle difference in degrees, respecting angles <0 or >360. |
|
Calculate 2D angle between positive z-axis and a line from reference to target position in degrees |
|
Calculate 2D Euclidean distance between two positions |
|
Transform cartesian to spherical coordinates |
|
Create resampling index at desired sample rate |
|
Calculate cummean with previous neighbour interpolation |
|
Convert rotation in Unity Euler angles (in degrees) into 3D rotation matrix |
|
Convert a 3x3 rotation matrix to Unity-style Euler angles (in degrees) |
|
Convert rotation in Unity Euler angles (in degrees) into a quaternion |
|
Convert a 3D rotation quaternion into Unity Euler angles (in degrees) |
|
Convert a 3D rotation quaternion into a Rotation Matrix |
|
Convert a 3x3 rotation matrix to a rotation quaternion |
|
Find index of maximum, avoiding warnings and errors |
|
Find index of minimum, avoiding warnings and errors |
|
Find maximum, avoiding warnings |
|
Find minimum, avoiding warnings |
|
Compute the geometric median rotation from a list of quaternions |
|
Perpendicular distance of p3 from p1 along p1p2 |
|
Project vector x onto vector y |
|
Project 3D-vector x into the plane spanned by y and z |
|
Compute central angle between two rotation matrices, for a direction vector |
|
Apply a rotation matrix R to rot_x rot_y and rot_z columns |
|
Compute the mean across a vector |
|
Find a rotation matrix that maps one vector onto the other |
|
Statistical ModellingFit statistical models to data |
|
Fit (generalised) linear model, checking for convergence, and obtain marginal means |
|
Fit (generalised) linear random effects model robustly, checking for convergence |
|
Safely fit a linear mixed-effects model using lme4::lmer |
|
Plotting functionsScale, theme and plot 3D movement |
|
Plot 3D movements for one trial |
|
Pastel colored ggplot scale |
|
VR Threat End State ggplot scale |
|
VR Threat Planning Time ggplot scale |
|
VR Threat Scenario Type ggplot scale |
|
VR Threat ggplot theme #' |
|
Produce a heatmap of movement data filtered by actions and action labels |
|
Plot a graph using community bubbles |
|
ValidationValidate inputs and generate expressive warnings |
|
Validate if given tibble has required columns. |
|
Ensures if given tibble has |
|
Ensures if given tibble has either |
|
Ensures if given tibble has either |
|
Ensures if given tibble has |
|
Ensures if given tibble has |
|
Validate if given tibble has a time column, checks if all NA and ensures minimum length |
|
Validates that the argument is numeric. Fail quietly if NA_real_ |
|
Validates that an option parameter is one of the allowed values. |
|
Ensures if given list has |
|
Check for NULLs |
|
Validate tibble, ensure minimum length and check for fully NA columns |
|
Validate if given tibble has enough timestamps in |
|
Check if two data frames with |
|
Ensure every vector has the same length or has length 1 |
|
UtilityDeal with unity file management |
|
Compare Column Names Between Two Data Frames |
|
Create Directory Paths Recursively |
|
Extract and annotate weapon-related details from raw event messages |
|
Find Hierarchy Object |
|
Find Hierarchy Object Matching Any Name |
|
Find messages in a session log and assign to trials |
|
Identify Columns with Missing Values |
|
Prepare trial results tibble for public release |
|
Remove Columns with All Missing Values |
|
Source Functions, Run Tests, and Report Coverage |
|
ConstantsConstants |
|
Example Data containing player movement and eye tracking |
|
Common fruit object names used in VRthreat Unity |
|