An htmlwidgets binding for calendar heat maps using d3
JavaScript CSS R
Switch branches/tags
Nothing to show
Clone or download
Latest commit 6d0f7b7 Jan 6, 2015
Permalink
Failed to load latest commit information.
R initial commit Jan 6, 2015
inst/htmlwidgets initial commit Jan 6, 2015
.Rbuildignore initial commit Jan 6, 2015
.gitignore initial commit Jan 6, 2015
DESCRIPTION initial commit Jan 6, 2015
LICENSE initial commit Jan 6, 2015
NAMESPACE initial commit Jan 6, 2015
README.md initial commit Jan 6, 2015
rChartsCalmap.Rproj initial commit Jan 6, 2015

README.md

rChartsCalmap

This is an htmlwidgets binding for the excellent Cal-Heatmap plugin, developed by Wan Qi Chen. This binding was motivated by a tweet by Alex Bresler and uses data provided by him on points scored by Paul George.

You can install it from github using devtools.

library(devtools)
install.packages('htmlwidgets')
install_github("ramnathv/rChartsCalmap")

Quick Start

Let us start with some data on points scored by Paul George.

dat <- read.csv('http://t.co/mN2RgcyQFc')[,c('date', 'pts')]
library(rChartsCalmap)
r1 <- calheatmap(x = 'date', y = 'pts',
  data = dat, 
  domain = 'month',
  start = "2012-10-27",
  legend = seq(10, 50, 10),
  itemName = 'point',
  range = 7
)
r1

calmap1

Here is another example showing stock price of APPLE.

library(quantmod)
getSymbols("AAPL")
xts_to_df <- function(xt){
  data.frame(
    date = format(as.Date(index(xt)), '%Y-%m-%d'),
    coredata(xt)
  )
}

dat = xts_to_df(AAPL)
calheatmap('date', 'AAPL.Adjusted', 
  data = dat, 
  domain = 'month',
  legend = seq(500, 700, 40),
  start = '2014-01-01',
  itemName = '$$'
)

apple