Browse Source

Style guide and DESCRIPTION

master
Mathew Kiang 6 years ago
parent
commit
88c06888db
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 4
      DESCRIPTION
  2. 6
      R/statebins.R
  3. 4
      R/util.R

4
DESCRIPTION

@ -11,7 +11,9 @@ Authors@R: c(
person("Brian", "Adams", email = "btadams478@gmail.com", role = "ctb", person("Brian", "Adams", email = "btadams478@gmail.com", role = "ctb",
comment = "theme testing & feedback"), comment = "theme testing & feedback"),
person("Thomas", "Wood", role = "ctb", 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> Maintainer: Bob Rudis <bob@rud.is>
Description: Cartogram heatmaps are an alternative to choropleth maps for 'USA' States Description: Cartogram heatmaps are an alternative to choropleth maps for 'USA' States

6
R/statebins.R

@ -43,10 +43,10 @@
#' theme_statebins(legend_position="right") #' theme_statebins(legend_position="right")
statebins <- function(state_data, statebins <- function(state_data,
state_col="state", value_col="value", state_col="state", value_col="value",
dark_label = "black", light_label = "white", na_label = "white", dark_label="black", light_label="white",
font_size=3, na_label="white", font_size=3,
state_border_col="white", state_border_size=2, state_border_col="white", state_border_size=2,
round = FALSE, radius = grid::unit(6, "pt"), round=FALSE, radius=grid::unit(6, "pt"),
ggplot2_scale_function=ggplot2::scale_fill_distiller, ggplot2_scale_function=ggplot2::scale_fill_distiller,
...) { ...) {

4
R/util.R

@ -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) hex_color <- gsub("#", "", hex_color)
@ -14,7 +15,6 @@
YIQ >= 128, dark_color, light_color) YIQ >= 128, dark_color, light_color)
) )
) )
} }
# sanity checks for state values # sanity checks for state values

Loading…
Cancel
Save