ConvertData | R Documentation |
Converting Input data with different coding scheme to standard format
ConvertData(
input,
yesLabel = NULL,
noLabel = NULL,
missLabel = NULL,
data.type = c("WHO2012", "WHO2016")[1]
)
input |
matrix input, the first column is ID, the rest of the columns each represent one symptom |
yesLabel |
The value(s) coding "Yes" in the input matrix. |
noLabel |
The value(s) coding "No" in the input matrix. |
missLabel |
The value(s) coding "Missing" in the input matrix. |
data.type |
The coding scheme of the output. This can be either "WHO2012" or "WHO2016". |
a data frame coded as follows. For WHO2012 scheme: "Y" for yes, "" for No, and "." for missing. For WHO2016 scheme: "y" for yes, "n" for No, and "-" for missing.
Other data conversion:
ConvertData.phmrc()
# make up a fake 2 by 3 dataset with 2 deaths and 3 symptoms
id <- c("d1", "d2")
x <- matrix(c("Yes", "No", "Don't know",
"Yes", "Refused to answer", "No"),
byrow = TRUE, nrow = 2, ncol = 3)
x <- cbind(id, x)
colnames(x) <- c("ID", "S1", "S2", "S3")
# see possible raw data (or existing data created for other purpose)
x
new <- ConvertData(x, yesLabel = "Yes", noLabel = "No",
missLabel = c("Don't know", "Refused to answer"))
new
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.