file_clean: Clean CSV file generated by create_csv() using clean_data()

View source: R/file_clean.R

file_cleanR Documentation

Clean CSV file generated by create_csv() using clean_data()

Description

A wrapper for the OpenPoseR function clean_data() that makes it possible to directly pass a file name and or path including a file name to the function. Caution: This will overwrite the CSV file passed as an argument with its output, unless otherwise specified using overwrite = FALSE.

Can be used to use clean_data() for a CSV file (*.csv) created using the create_csv() function without manually loading the data from the file into R first.

Usage

file_clean(file, model, cutoff, overwrite = TRUE)

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() this package).

cutoff

Optional. Defaults to .1 as threshold.

overwrite

Optional. Defaults to TRUE. If FALSE will write outptu to "filename_cleaned.csv" in the input directory.

Examples

# Clean file "~/myvideo/myvideo_body25.csv"
file_clean("~/myvideo/myvideo_body25.csv")

# Clean file "~/myvideo/myvideo_body25.csv" with probability < .5
file_clean("~/myvideo/myvideo_body25.csv", .5)

# Clean file "~/myvideo/myvideo_body25.csv" and do not overwrite file
file_clean("~/myvideo/myvideo_body25.csv", overwrite = FALSE)

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