Learn R Programming

cmAnalysis (version 1.0.0)

numberOfStatements: Count the Number of Statements in Concept Map Data

Description

This function calculates the number of unique statements in a given concept mapping dataset.

Usage

numberOfStatements(CMData, verbose = TRUE)

Value

An integer representing the number of unique statements in the dataset.

Arguments

CMData

A data frame containing concept map data. This must include a column named "statement".

verbose

A logical, if TRUE, the function will print the number of statements the console.

Details

The function first checks if the provided dataset is suitable for concept mapping using the
checkConceptMapData function. If the data is valid, it calculates and returns the number of unique statements.

Examples

Run this code
# Example of valid data
CMData <- 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")
)

# Count the number of statements silently
numberOfStatements(CMData, verbose = FALSE)

# Count the number of statements with message
numberOfStatements(CMData)

Run the code above in your browser using DataLab