updatemat | R Documentation |
This function updates an existing interaction matrix based on new group assignments. It increments the matrix values to track how often students have been grouped together.
updatemat(initialmat, group_assignments, students)
initialmat |
A square matrix where rows and columns represent students, and cell values track the number of times two students have been grouped together. |
group_assignments |
A vector indicating the group assignments for each student. |
students |
A vector containing student identifiers corresponding to the matrix row and column names. |
An updated matrix reflecting the new group assignments.
n_students <- 4
student_data <- GenerateData(n_students)
initial_matrix <- initmat(student_data$Student)
group_assignments <- c(1, 1, 2, 2) # Example group assignments
updated_matrix <- updatemat(initial_matrix, group_assignments, student_data$Student)
updated_matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.