I'm trying to create a choropleth map using a .shp shapefile and a csv. I'm stuck on the inner_join
step and keep receiving the error below, even after using colClass
function to change the variable type to match my shapefile data. Anyone know what the issue may be?
ods_total<-read.csv("ods.csv",stringsAsFactors = FALSE,colClasses = c("STATE_FIPS"="integer"))
> typeof(ods_total$STATE_FIPS)
[1] "integer"
> typeof(map$STATE_FIPS)
[1] "integer"
> map_data<-inner_join(map,ods_total)
Joining, by = c("STATE_NAME", "DRAWSEQ", "STATE_FIPS")
**Error: Can't join on 'STATE_FIPS' x 'STATE_FIPS' because of incompatible types (factor / integer)**"