Skip to content

Print state abbreviation even if value is NA #14

@mkiang

Description

@mkiang

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions