View source: R/consistency_check.R
consistency_check | R Documentation |
This function performs a consistency check to ensure that the number of tests
is greater than the number of cases for given columns in a dataset. It
returns a ggplot2
object visualizing the results.
consistency_check(data, tests, cases)
data |
A data frame containing the test and case data. |
tests |
A character vector specifying the column names for the test data. |
cases |
A character vector specifying the column names for the case data. The length of 'tests' and 'cases' must be the same, and each element in 'tests' corresponds to an element in 'cases'. |
A ggplot2::ggplot()
object showing
the consistency between the number of tests and cases. The x-axis represents
the cases, and the y-axis represents the tests. Each facet represents a
disease, and the diagonal line shows where the number of tests equals the
number of cases.
# check the consistency between malaria tests and cases
# get path
path <- system.file(
"extdata",
"fake_epi_df_togo.rds",
package = "epiCleanr")
fake_epi_df_togo <- import(path)
consistency_check(fake_epi_df_togo,
tests = c("malaria_tests","cholera_tests"),
cases = c("malaria_cases", "cholera_cases"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.