## ----setup, include = FALSE--------------------------------------------------- knitr::opts_chunk$set( collapse = TRUE, comment = "#>", message = FALSE, warning = FALSE ) ## ----essential-functions, results='asis', echo=FALSE, message=FALSE, warning=FALSE---- library(engager) essential_functions <- c( "basic_transcript_analysis", "quick_analysis", "batch_basic_analysis", "load_zoom_transcript", "process_zoom_transcript", "consolidate_transcript", "summarize_transcript_metrics", "summarize_transcript_files", "analyze_transcripts", "plot_users", "write_metrics", "load_roster", "detect_unmatched_names", "match_names_workflow", "write_unresolved", "ensure_privacy", "privacy_audit", "anonymize_educational_data", "validate_privacy_compliance", "review_privacy_risks", "generate_privacy_review_report" ) stopifnot(all(essential_functions %in% getNamespaceExports("engager"))) # Emit a markdown list with autolinkable inline code items cat("Supported workflow functions (", length(essential_functions), "):\n\n") cat(paste0("- `", essential_functions, "()`"), sep = "\n") ## ----load-transcript---------------------------------------------------------- # Load a sample transcript transcript_file <- system.file("extdata/test_transcripts/intro_statistics_week1.vtt", package = "engager" ) # Load the transcript transcript <- load_zoom_transcript(transcript_file) cat("Transcript loaded with", nrow(transcript), "comments\n") ## ----process-transcript------------------------------------------------------- # Process transcript with privacy defaults processed <- process_zoom_transcript( transcript_df = transcript, add_dead_air = TRUE, consolidate_comments = TRUE ) metrics <- summarize_transcript_metrics( transcript_df = processed, names_exclude = c("dead_air") ) head(metrics) ## ----plot-and-export---------------------------------------------------------- engagement_plot <- plot_users( metrics, metric = "n", facet_by = "none", mask_by = "name" ) print(engagement_plot) output_file <- tempfile(fileext = ".csv") write_metrics( metrics, what = "engagement", path = output_file, comments_policy = "omit" ) stopifnot(file.exists(output_file)) unlink(output_file) ## ----privacy-compliance------------------------------------------------------- # Check privacy risk with synthetic data synthetic_data <- data.frame( name = c("Student A", "Student B", "Instructor"), message = c("Hello", "Good morning", "Welcome to class"), timestamp = c("00:01:00", "00:02:00", "00:00:30") ) # Privacy review helpers flag recognized identifier-like columns. They do not # prove that a data set or free-text field contains no identifying information. privacy_review <- review_privacy_risks(synthetic_data, audit_log = FALSE) privacy_review$pii_detected privacy_review$recommendations