Mathew Kiang
6 years ago
No known key found for this signature in database
GPG Key ID: 1D7529BE14E2BBA9
3 changed files with
8 additions and
6 deletions
-
DESCRIPTION
-
R/statebins.R
-
R/util.R
|
|
@ -11,7 +11,9 @@ Authors@R: c( |
|
|
|
person("Brian", "Adams", email = "btadams478@gmail.com", role = "ctb", |
|
|
|
comment = "theme testing & feedback"), |
|
|
|
person("Thomas", "Wood", role = "ctb", |
|
|
|
comment = "Significant suggestions & testing that made new features possible") |
|
|
|
comment = "Significant suggestions & testing that made new features possible"), |
|
|
|
person("Mathew", "Kiang", role = "ctb", |
|
|
|
comment = "Minor fix for NA handling") |
|
|
|
) |
|
|
|
Maintainer: Bob Rudis <bob@rud.is> |
|
|
|
Description: Cartogram heatmaps are an alternative to choropleth maps for 'USA' States |
|
|
|
|
|
@ -43,8 +43,8 @@ |
|
|
|
#' theme_statebins(legend_position="right") |
|
|
|
statebins <- function(state_data, |
|
|
|
state_col="state", value_col="value", |
|
|
|
dark_label = "black", light_label = "white", na_label = "white", |
|
|
|
font_size=3, |
|
|
|
dark_label="black", light_label="white", |
|
|
|
na_label="white", font_size=3, |
|
|
|
state_border_col="white", state_border_size=2, |
|
|
|
round=FALSE, radius=grid::unit(6, "pt"), |
|
|
|
ggplot2_scale_function=ggplot2::scale_fill_distiller, |
|
|
|
|
|
@ -1,4 +1,5 @@ |
|
|
|
.sb_invert <- function(hex_color, dark_color="black", light_color="white", na_color = "white") { |
|
|
|
.sb_invert <- function(hex_color, dark_color="black", light_color="white", |
|
|
|
na_color="white") { |
|
|
|
|
|
|
|
hex_color <- gsub("#", "", hex_color) |
|
|
|
|
|
|
@ -14,7 +15,6 @@ |
|
|
|
YIQ >= 128, dark_color, light_color) |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# sanity checks for state values |
|
|
|