Skip to content

R Package for tessellated hexagon grid maps of US states in R + ggplot2

Notifications You must be signed in to change notification settings

gudaleon/rGridMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rGridMap

An R Package for tessellated hexagon grid maps of US states in R + ggplot2

Inspired by the blog post by Danny DeBelius of the NPR visuals team and the general 2015 tweet storm and Flowing Data covereage of grid maps.

It is easy to use!

Installation

Use install_github from the devtools package

library(devtools)
install_github('arvi1000/rGridMap')

A toy example

# a data.frame of states with random categorical value
my_dat <- data.frame(state.abb = c(state.abb, 'DC'), # don't forget DC!
                     value=sample(LETTERS[1:5], 51, replace=T))

# build grid map plot
my_grid_map <- plotGridMap(my_dat, fill_var = 'value')

# and you can manipulate the resultant object as you would any ggplot object
my_grid_map +
 scale_fill_brewer(type='qual') +
 labs(title = 'States by Category', fill = 'Category')

An example with real data

(See the examples folder for code)

About

R Package for tessellated hexagon grid maps of US states in R + ggplot2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • R 100.0%