View source: R/validate_accelerometry_data.R
validate_accelerometry_data | R Documentation |
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.
validate_accelerometry_data(accelerometry_counts)
accelerometry_counts |
Raw accelerometry data with the expected schema. |
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
and activity_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.
This function does not return anything. It throws an error if the accelerometry data fails any of the validation checks.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.