View source: R/nbc4va_validation.R
internalCheckNBC | R Documentation |
Performs checks to ensure that the arguments passed to internalNBC
are correct.
This function will also auto-clean when appropriate, and display
warning messages of the cleaning tasks.
internalCheckNBC(train, test, known = TRUE, assume = FALSE, unknown = 99)
train |
Dataframe of verbal autopsy train data (See Data documentation).
Example:
| ||||||||||||||||||||
test |
Dataframe of verbal autopsy test data in the same format as train except if causes are not known:
| ||||||||||||||||||||
known |
TRUE to indicate that the test causes are available in the 2nd column and FALSE to indicate that they are not known | ||||||||||||||||||||
assume |
TRUE to set all symptoms not equal to 1 as 0 and FALSE to raise error if symptoms are not 0 or 1. This takes priority over unknown. | ||||||||||||||||||||
unknown |
A single integer value which determines if a symptom is unknown as to if is present or absent.
|
The following checks are applied to train and test to ensure they:
are a dataframe
have required number of rows and columns
have required data types for each column
have required symptom values
are in the same format
have unique ids
out A list object containing the checked inputs:
$train: dataframe of id, cause and symptoms
$test: dataframe of id, cause and symptoms in the same format as train
$known: TRUE if the test causes are known or FALSE if not
Other validation functions:
internalCheckNBCSummary()
library(nbc4va) data(nbc4vaData) # Check train and test inputs, error if it does not pass check train <- nbc4vaData[1:50, ] test <- nbc4vaData[51:100, ] checked <- nbc4va::internalCheckNBC(train, test) train <- checked$train test <- checked$test
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.