Permalink
Browse files

added a heatmap github plot template

  • Loading branch information...
1 parent b4b6b37 commit fe578e013bfa87b31c802672cd2d27fce23e0b1d @sckott sckott committed Apr 2, 2013
Showing with 53 additions and 2 deletions.
  1. +1 −0 DESCRIPTION
  2. +3 −2 NAMESPACE
  3. +24 −0 R/github_heatmap.R
  4. +25 −0 man/github_heatmap.Rd
View
@@ -32,3 +32,4 @@ Collate:
'ti_providers.R'
'github_plot.R'
'github_report.R'
+ 'github_heatmap.R'
View
@@ -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)
View
@@ -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())
+}
View
@@ -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 fe578e0

Please sign in to comment.