metrumresearchgroup / review

helpful tools for organizing and performing quality control (QC) tasks
https://metrumresearchgroup.github.io/review/
2 stars 0 forks source link

Count additions/modifications with diff tool #119

Open michaelmcd18 opened 3 months ago

michaelmcd18 commented 3 months ago
diff <- review::diffPreviousRevisions("script/eda-tables-report.Rmd", .previous_revision = 90, .current_revision = 614)

diff@cur.dat[["tok.rat"]] %>%  
  as.data.frame() %>% 
  dplyr::rename(Edits = ".") %>% 
  dplyr::mutate(
    Changes = case_when(
      Edits == 0 ~ "Deletions", 
      Edits == 1 ~ NA_character_,
      TRUE ~ "Modifications"
    )
  ) %>% 
  dplyr::count(Changes) %>% 
  dplyr::filter(!is.na(Changes))