Learn R Programming

cmAnalysis (version 1.0.0)

printSorters: Print and Return Unique Sorters in Concept Map Data

Description

This function retrieves and optionally prints the unique sorters (users) in a given concept mapping dataset.

Usage

printSorters(CMData, verbose = TRUE)

Value

A vector of unique sorter IDs.

Arguments

CMData

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

verbose

A logical, if TRUE, the function will print the list of unique sorters to 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 retrieves the unique sorter IDs from the sorterID column. If verbose = TRUE, the function prints the sorter IDs.

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")
)

# Retrieve unique sorters without printing
printSorters(CMData, verbose = FALSE)

# Retrieve and print unique sorters to console
printSorters(CMData)

Run the code above in your browser using DataLab