Skip to content

Instantly share code, notes, and snippets.

@sAbakumoff
Created September 11, 2016 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sAbakumoff/addf6fbf1362428c7572b0e87df71bb4 to your computer and use it in GitHub Desktop.
Save sAbakumoff/addf6fbf1362428c7572b0e87df71bb4 to your computer and use it in GitHub Desktop.
angular_commits_type_scope <- react_angular_commits %>%
filter(name=="angular.js",
str_detect(message, "^(feat|fix|docs|style|refactor|test|chore)\\s*\\(")) %>%
mutate(type=trimws(str_sub(message, start=0, end=regexpr( "\\(", message ) - 1)),
scope=trimws(str_sub(message,
start=regexpr( "\\(", message ) + 1,
end=regexpr( "\\)", message ) - 1))) %>%
select(type, scope)
top_scope<-angular_commits_type_scope %>%
count(scope, sort=TRUE) %>%
head(10) %>%
select(-n)
angular_commits_type_scope %>%
inner_join(top_scope) %>%
count(type, scope) %>%
ggplot(aes(type, n, fill = scope)) +
geom_bar(stat = "identity", position = "dodge") +
labs(x = "", y = "Number of commits", fill = "")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment