Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print state abbreviation even if value is NA #14

Open
mkiang opened this issue Apr 11, 2018 · 0 comments
Open

Print state abbreviation even if value is NA #14

mkiang opened this issue Apr 11, 2018 · 0 comments

Comments

@mkiang
Copy link
Contributor

mkiang commented Apr 11, 2018

Right now the state abbreviations will not print if a value is NA:

library(statebins)
library(dplyr)
data(USArrests)

USArrests$state <- rownames(USArrests)
USArrests$Assault[1] <- NA

statebins(USArrests, value_col="Assault", name = "Assault", round=TRUE) +
    theme_statebins(legend_position="right")

Which returns this error:

1: In .sb_invert(gb$data[[1]]$fill, dark_label, light_label) :
  NAs introduced by coercion

It would be nice to still have the abbreviation printed -- possibly with a user-specified color.

@mkiang mkiang mentioned this issue Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant