Description Usage Arguments Value Examples
Performs a test that a specific column has an expected mean value. Optionally - an acceptable tolerance can be specified in standard deviations.
1 | test_column_mean(df, col, mean_expected, sd_tolerance = 0)
|
df |
A dataframe |
col |
The unquoted column name of the column you want to test |
mean_expected |
The expected mean value |
sd_tolerance |
The maximum number of standard deviations (+/-) tolerance |
The dataframe passed to the function.
1 2 3 4 5 6 7 | # Basic usage
test_column_mean(mtcars, qsec, 17.84875)
# Usage without a stdev tolerance means match must be exactly equal
# Often including a small tolerance is good to allow for rounding errors
mtcars %>%
test_column_mean(mpg, 20.09062, 0.01)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.