file_acceleration: Compute acceleration for CSV file generated by create_csv(),...

View source: R/file_acceleration.R

file_accelerationR Documentation

Compute acceleration for CSV file generated by create_csv(), using acceleration_x() and acceleration_y()

Description

A wrapper for the OpenPoseR functions acceleration_x() and acceleration_y() that makes it possible to directly pass a file name and or path including a file name to the function. Will create two CSV files with the infixes "acceleration_x" and "acceleration_y" in the given input directory as its output.

Can be used to call acceleration_x() and acceleration_y() for a CSV file (*.csv) created using the create_csv() function and (optinally but recommend) cleaned with either clean_data() or file_clean() without manually loading the data from the file into R first.

Usage

file_acceleration(file, model, fps = 25)

Arguments

file

Name of CSV file (*.csv) or path to file including filename.

model

Specify which tracking model generated the data. Supply either body25, hands, or face. If no model is supplied the model will be guessed on the basis of the CSV file name provided (the file name contains model information when created using create_csv() from this package).

fps

Optional. Frames per second of original video file used for tracking. Defaults to 25.

Examples

# Compute acceleration for file "~/myvideo/myvideo_body25.csv"
file_acceleration("~/myvideo/myvideo_body25_cleaned.csv")

# Compute acceleration for file "~/myvideo/myvideo.csv" and manually specify model
file_acceleration("~/myvideo/myvideo_cleaned.csv", model = "body25")

trettenbrein/OpenPoseR documentation built on April 22, 2022, 4:03 a.m.