Skip to contents

Prepares dataframe and provide a preliminary analysis

Usage

prepare_data(x, print_plot = TRUE)

Arguments

x

a dataframe with two numeric columns named "speed" and "acc". speed values should be m/s. If import function has been used, the columns will automatically bw named "speed" and "acc"

print_plot

A logical to control if a preliminary plot is printed, by default TRUE. This plot show the initial fit of the model and may serve to determine if the quality of the GPS data sufficient.

Details

This function prepares the input dataframe by: filtering acc >= 0, filtering speed >= 3, creating speed bins by 0.1 ms (suggested by Cormier et al. 2023), and indentifying the highest two acc values in each speed bin. The function outputs an initial linear regression analysis and associated scatterplot for initial data inspection.

Examples

prepare_data(sample_data)
#> `geom_smooth()` using formula = 'y ~ x'