knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
The goal of gitStats is to provide better git statistics about lines added/removed in git projects.
You can install gitStats from github with:
# install.packages("devtools") devtools::install_github("zzawadz/gitStats")
This is a basic example which shows you how to solve a common problem:
library(dplyr) library(tidyr) path <- "/tmp/dplyr/" if(!file.exists(path)) { git2r::clone("git@github.com:tidyverse/dplyr.git", local_path = path) } data <- gstat_gather_data(path) authors <- unique(data[["Author"]]) romain <- authors[grep(unique(authors), pattern = "^Romain")] hadley <- authors[grep(unique(authors), pattern = "adl")] authosrRenameMap <- setNames(rep(romain[2], length(romain)), romain) authosrRenameMap <- c(authosrRenameMap, "hadley" = "Hadley Wickham") dtCleanAuthors <- gstat_rename_authors(data, authosrRenameMap) dtCleanAuthors %>% group_by(Author) %>% summarise(Added = sum(Added), Removed = sum(Removed)) %>% arrange(desc(Added))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.