Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added a heatmap github plot template

  • Loading branch information...
commit fe578e013bfa87b31c802672cd2d27fce23e0b1d 1 parent b4b6b37
Scott Chamberlain authored April 01, 2013
1  DESCRIPTION
@@ -32,3 +32,4 @@ Collate:
32 32
     'ti_providers.R'
33 33
     'github_plot.R'
34 34
     'github_report.R'
  35
+    'github_heatmap.R'
5  NAMESPACE
... ...
@@ -1,9 +1,10 @@
1  
-export(IS_providers)
2  
-export(ISid)
3 1
 export(about_IS)
4 2
 export(collection_metrics)
5 3
 export(create_ISid)
  4
+export(github_heatmap)
6 5
 export(github_plot)
7 6
 export(github_report)
  7
+export(IS_providers)
  8
+export(ISid)
8 9
 export(metrics)
9 10
 export(save_collection)
24  R/github_heatmap.R
... ...
@@ -0,0 +1,24 @@
  1
+
  2
+#' Generates a heatmap plot visualizing GitHub repos.
  3
+#'
  4
+#' Takes output of github_reports and makes a somewhat nice visualization
  5
+#' @param df Input \code{data.frame}. Must be generated by \link{github_report}
  6
+#' @export
  7
+#' @return \code{ggplot}
  8
+#' @examples \dontrun{
  9
+#' df <- github_report("d4npn7")
  10
+#' # To visualize this, then use
  11
+#' github_heatmap(df)
  12
+#'}
  13
+github_heatmap <- function(df) {
  14
+	ggplot(df) + geom_tile(aes(x=title, y=metric, fill=count)) + 
  15
+		theme_bw(base_size = 16) + 
  16
+		coord_flip() +
  17
+		scale_fill_gradient("Raw counts", high = "#132B43", low = "white") +
  18
+		labs(x = "", y = "") + 
  19
+		theme(
  20
+			axis.ticks = element_blank(), 
  21
+			panel.grid.major = element_blank(),
  22
+			panel.grid.minor = element_blank(),
  23
+			panel.border = element_blank())	
  24
+}
25  man/github_heatmap.Rd
... ...
@@ -0,0 +1,25 @@
  1
+\name{github_heatmap}
  2
+\alias{github_heatmap}
  3
+\title{Generates a heatmap plot visualizing GitHub repos.}
  4
+\usage{
  5
+  github_heatmap(df)
  6
+}
  7
+\arguments{
  8
+  \item{df}{Input \code{data.frame}. Must be generated by
  9
+  \link{github_report}}
  10
+}
  11
+\value{
  12
+  \code{ggplot}
  13
+}
  14
+\description{
  15
+  Takes output of github_reports and makes a somewhat nice
  16
+  visualization
  17
+}
  18
+\examples{
  19
+\dontrun{
  20
+df <- github_report("d4npn7")
  21
+# To visualize this, then use
  22
+github_heatmap(df)
  23
+}
  24
+}
  25
+

0 notes on commit fe578e0

Please sign in to comment.
Something went wrong with that request. Please try again.