This document presents the analysis of the review comments for the CMCs (Calibration and Measurement Capabilities) at the intraregional level for the SIM. The data cycle analyzed is XXVI (2025)and sourced from KCDB of March 23, 2026.
# Libraries
library(readxl)
library(dplyr)
library(purrr)
library(ggplot2)
library(stringr)
library(tidyr)
library(forcats)
library(writexl)
# File path (Make sure to replace this with your actual file path)
file_path <- "C:/Users/Bryan Calderón/Desktop/KCDB data.xlsx"
# Get sheet names
sheets <- excel_sheets(file_path)
# Function to extract necessary columns
extract_data <- function(sheet) {
df <- read_excel(file_path, sheet = sheet)
names(df) <- toupper(trimws(names(df)))
if(all(c("RMO", "COMMENT") %in% names(df))) {
df %>%
select(RMO, COMMENT) %>%
filter(!is.na(COMMENT)) %>%
mutate(SHEET_NAME = sheet)
}
}
# Apply function to all sheets
final_df <- map_dfr(sheets, extract_data)
# Show the first few rows
head(final_df)## # A tibble: 6 × 3
## RMO COMMENT SHEET_NAME
## <chr> <chr> <chr>
## 1 AFRIMETS Please respond to comments from reviewers. SIM-QM-CR…
## 2 AFRIMETS The Record of participation and Core Capability matrix do… SIM-QM-CR…
## 3 AFRIMETS The Record of participation and Core Capability matrix do… SIM-QM-CR…
## 4 AFRIMETS Comments for publication column will be published on the … SIM-QM-CR…
## 5 AFRIMETS A record of participation to support a core competency cl… SIM-QM-CR…
## 6 COOMET Please check whether uncertainty convention 2 has been ch… SIM-QM-CR…
plot_rmo <- final_df %>%
count(RMO) %>%
ggplot(aes(x = fct_reorder(RMO, n), y = n)) +
geom_col(fill = "steelblue") +
coord_flip() +
labs(
title = "Total Comments per RMO",
x = "RMO",
y = "Number of Comments"
) +
theme_minimal()
plot_rmoplot_category <- final_df %>%
count(CATEGORY) %>%
ggplot(aes(x = fct_reorder(CATEGORY, n), y = n)) +
geom_col(fill = "darkorange") +
coord_flip() +
labs(
title = "Distribution of Comment Categories",
x = "Category",
y = "Number of Comments"
) +
theme_minimal()
plot_category
2. COMMENT CLASSIFICATION
Below, an automatic classification of the comments is performed using specific keywords through regular expressions.