R/github_heatmap.R

Defines functions github_heatmap

Documented in github_heatmap

#' Generates a heatmap plot visualizing GitHub repos.
#'
#' Takes output of github_reports and makes a somewhat nice visualization
#' @param df Input \code{data.frame}. Must be generated by \link{github_report}
#' @export
#' @return \code{ggplot}
#' @examples \dontrun{
#' df <- github_report("d4npn7")
#' # To visualize this, then use
#' github_heatmap(df)
#'}
github_heatmap <- function(df) {
	ggplot(df) + geom_tile(aes(x=title, y=metric, fill=count)) + 
		theme_bw(base_size = 16) + 
		coord_flip() +
		scale_fill_gradient("Raw counts", high = "#132B43", low = "white") +
		labs(x = "", y = "") + 
		theme(
			axis.ticks = element_blank(), 
			panel.grid.major = element_blank(),
			panel.grid.minor = element_blank(),
			panel.border = element_blank())	
}
ropensci/rImpactStory documentation built on May 18, 2022, 6:30 p.m.