Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from ropensci/gh_heatmap
Browse files Browse the repository at this point in the history
added a heatmap github plot template
  • Loading branch information
karthik committed Apr 2, 2013
2 parents b4b6b37 + fe578e0 commit 9c6da6d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Expand Up @@ -32,3 +32,4 @@ Collate:
'ti_providers.R'
'github_plot.R'
'github_report.R'
'github_heatmap.R'
5 changes: 3 additions & 2 deletions NAMESPACE
@@ -1,9 +1,10 @@
export(IS_providers)
export(ISid)
export(about_IS)
export(collection_metrics)
export(create_ISid)
export(github_heatmap)
export(github_plot)
export(github_report)
export(IS_providers)
export(ISid)
export(metrics)
export(save_collection)
24 changes: 24 additions & 0 deletions R/github_heatmap.R
@@ -0,0 +1,24 @@

#' 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())
}
25 changes: 25 additions & 0 deletions man/github_heatmap.Rd
@@ -0,0 +1,25 @@
\name{github_heatmap}
\alias{github_heatmap}
\title{Generates a heatmap plot visualizing GitHub repos.}
\usage{
github_heatmap(df)
}
\arguments{
\item{df}{Input \code{data.frame}. Must be generated by
\link{github_report}}
}
\value{
\code{ggplot}
}
\description{
Takes output of github_reports and makes a somewhat nice
visualization
}
\examples{
\dontrun{
df <- github_report("d4npn7")
# To visualize this, then use
github_heatmap(df)
}
}

0 comments on commit 9c6da6d

Please sign in to comment.