# Create a snapshot transform that replaces known paths with ''. # Normalizes path separators before replacing for cross-platform consistency. snap_replace <- function(...) { paths <- c(...) function(x) { x <- gsub('\\\\', '/', x) for (p in paths) { x <- gsub(gsub('\\\\', '/', p), '', x, fixed = TRUE) } x } }