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

range of numbers renders lowest number in black? #81

Open
MuraEnok opened this issue Oct 6, 2014 · 1 comment
Open

range of numbers renders lowest number in black? #81

MuraEnok opened this issue Oct 6, 2014 · 1 comment
Labels

Comments

@MuraEnok
Copy link

MuraEnok commented Oct 6, 2014

the lowest number in a series does not render in the color, but is being rendered as a black option. Example using data from FRED, and subsetting for 2012 will render North Dakota as black and not part of the blue color scheme. The same thing happens with the lowest overall number in the animate function?

library(lubridate)
library(dplyr)
library(rMaps)
#### get the data from FRED
state = state.abb
base = "http://research.stlouisfed.org/fred2/data/"
end = "UR.txt"
# put loop for all 50 states and create master list of all downloads
ui <- lapply(state, function(.st) {
  state = paste0(.st)
  input <- read.table(paste0(base, .st, end), skip=11, header=TRUE, as.is=TRUE)
  input$state = state
  # input$DATE <- as.Date(input$DATE, "%Y-%m-%d")

  input
})

ui_all <- do.call(rbind, ui)

ui_all <- 
            mutate(ui_all, year = year(ui_all$DATE), value = VALUE) %.%
            filter(year > 2006)  %.%
            select(state,  value,  year) %.%
            group_by( state, year) %.%
            summarise(avg = round(mean(value, na.rm=TRUE), digits =2))

#### create maps using the rMaps package for a test
ichoropleth(avg ~ state, data = subset(ui_all, year == 2012))
ichorolpleth(avg ~ state, data = ui_all, animate = 'year', play = TRUE
@ramnathv
Copy link
Owner

ramnathv commented Oct 6, 2014

This is a bug in this line. I need to pass the argument include.lowest = TRUE to cut so that the lowest values are also included. Thanks for reporting the bug.

@ramnathv ramnathv added the bug label Oct 6, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants