View source: R/checkConceptMapData.R
checkConceptMapData | R Documentation |
Checks whether the provided data frame meets the requirements for concept map data.
checkConceptMapData(CMData)
CMData |
A data frame containing concept map data. This data frame must include the required columns: "sorterID", "statement", and "stackID". |
This function performs the following checks on the input data:
Verifies that CMData
is a data frame.
Ensures the presence of required columns: "sorterID"
, "statement"
, and "stackID"
.
Confirms that there are at least 2 unique values in the "stackID"
column.
Confirms that there are at least 2 unique values in the "sorterID"
column.
Confirms that there are at least 2 unique values in the "statement"
column.
Returns TRUE
if all checks pass. If any check fails, an error is raised
with a descriptive message.
# Example of valid data
validData <- data.frame(
sorterID = c("resp1", "resp1", "resp1", "resp2",
"resp2", "resp2", "resp3", "resp3", "resp3"),
statement = c("London", "Frankfurt", "Berlin", "London",
"Frankfurt", "Berlin", "London", "Frankfurt", "Berlin"),
stackID = c("capital city", "city", "capital city", 1, 2, 2, "A", "B", "A")
)
checkConceptMapData(validData) # Should return TRUE
# Example of invalid data (missing columns)
invalidData <- data.frame(
sorterID = c(1, 2),
stackID = c(1, 2)
)
# checkConceptMapData(invalidData) # Will return False as an error
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.