Validate accelerometry input data
Source:R/validate_accelerometry_data.R
validate_accelerometry_data.Rd
The input schema for the accelerometry data is time
and activity_counts
.
time
should be a column in date-time format, in the UTC time zone, with no null values.activity_counts
should be a positive numeric column with no null values.
Value
This function does not return anything. It throws an error if the accelerometry data fails any of the validation checks.
Details
This function checks the schema of the accelerometry input data and raises an error if any schema constraints are violated.
The following schema validations are performed on the input data:
The input data must contain two columns, named
time
andactivity_counts
.The
time
column must be in date-time format, in the UTC time zone, with no null values.The
activity_counts
column must be a positive numeric column with no null values.
Examples
# Example usage:
data <- data.frame(
time = seq(
as.POSIXct("2021-01-01 00:00:00", tz = "UTC"),
as.POSIXct("2021-01-01 23:59:59", tz = "UTC"),
by = "5 mins"
)) %>%
dplyr::mutate(activity_counts = sample(0:100, length(time), replace = TRUE))
validate_accelerometry_data(data)