Skip to content

Instantly share code, notes, and snippets.

View arvi1000's full-sized avatar

Arvi Sreenivasan arvi1000

View GitHub Profile
# This is a quasi replication of the correlation matrix heatmap viz from Seaborn,
# using R and ggplot
# see: http://stanford.edu/~mwaskom/software/seaborn/examples/structured_heatmap.html
library(data.table)
library(ggplot2)
# get data
brain_url <- paste0('https://raw.githubusercontent.com/',
'mwaskom/seaborn-data/master/brain_networks.csv')
@arvi1000
arvi1000 / r_leaflet_readxl_example.R
Last active May 5, 2016 15:58
Example of reading data from an Excel file, geocoding, simple calculations, and plotting with Leaflet
library(leaflet)
library(readxl) # for read_excel()
library(ggmap) # for geocode()
library(fields) # for rdist.earth()
### read data from excel ----
# download to default working directory
download.file('https://dl.dropboxusercontent.com/u/12146012/place_names.xlsx',
destfile='place_names.xlsx')
places <- read_excel('place_names.xlsx')