trulia / choroplethr

choroplethr simplifies the creation of choropleths (thematic maps) in R
Other
141 stars 53 forks source link

Error on buckets=1 #34

Closed pssguy closed 9 years ago

pssguy commented 9 years ago
library(choroplethr)

region <-     c("romania","ukraine","russia","spain","hungary","italy","poland","bulgaria","portugal","turkey","greece","united kingdom","sweden","france","netherlands","belgium","germany","denmark","ireland","iceland","switzerland","norway")

value <- 
  c(12.5,10.5,10.5,7.5,7,9.5,6.3,6.5,7,5.5,5.1,4.2,4.6,3.7,2.2,4.5,3.3,2.4,2.1,2.2,2.5,1.8)

data <- data.frame(region=region,value=value)
str(data)
data$region <- as.character(data$region)

country_choropleth(data, zoom = data$region, buckets=1,
                   title="Av working days to earn same as CEO does in hour, 2012")

Error in solve.default(M) : 'a' must be a complex matrix

No problems with other buckets value choroplethr_2.1.1

technocrat commented 9 years ago

I cut and pasted the code and produced the attached with no error message with choroplethr_2.1.1 rplot under R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" Platform: x86_64-apple-darwin13.4.0 (64-bit)

arilamstein commented 9 years ago

Hmmm. I reinstalled the package via CRAN, did update.packages(), ran the code, and get the exact same image that @technocrat has. Like Richard, I am running R version 3.1.2.

@pssguy , I recommend doing and update.packages() and making sure that you are running the latest version of R. Can you do that and then post if you are still having the same problem?

That error message does not look familiar to me.

pssguy commented 9 years ago

@technocrat @arilamstein

I just re-ran code after restarting session and could not reproduce error. Maybe a conflict with another package I had open at the time? No obvious reason via googling. If it happens again, I'll do a bit more digging