I am not able to view Chattisgarh state from India, when I am trying to plot map of India with gvisGeochart

73 views Asked by At

I have with me data for all Indian states with its population. I have used following code

 `G3 <- gvisGeoChart(Population, "States", "Population",
  options=list(region="IN", displayMode="regions", 
  resolution="provinces",
  width=600, height=400))
  plot(G3)`

The map comes properly, but data for State Chattisgarh is not getting displayed (data is in the text file I uploaded). I have seen a similar graph on web, which also don't display the same.

http://visual.yantrajaal.com/2015/05/googlevis-best-of-r-and-googlecharts.html

1

There are 1 answers

0
Aurèle On

It works if you replace Chattisgarh with Chhattisgarh (with Chh...). Compare the two plots:

library(googleVis)
StateMilk <- read.table(
  text = "State 'Cow Milk CD'   'Cow Milk ND'   'Cow Milk Total'    'Buffalo Milk'  'Goat Milk' Total
'Andhra Pradesh'    1268.0  1054.0  2322.0  6603.0  0.4 8925.0
'Arunachal Pradesh' 9.0 23.0    32.0    NA  NA  32.0
Assam   166.0   462.0   628.0   100.0   25.0    752.0
Bihar   986.0   1958.0  2943.0  2623.0  216.0   5783.0
Chattisgarh 56.0    471.0   527.0   296.0   43.0    866.0",
  header = TRUE, stringsAsFactors = FALSE)
plot(gvisGeoChart(StateMilk, "State", "Total", 
                  options=list(region="IN", displayMode="regions", resolution="provinces", width=600, height=400)))

Chattisgarh wont display

StateMilk_with_2_h <- StateMilk
StateMilk_with_2_h$State[StateMilk_with_2_h$State == "Chattisgarh"] <- "Chhattisgarh"
plot(gvisGeoChart(StateMilk_with_2_h, "State", "Total", 
                  options=list(region="IN", displayMode="regions", resolution="provinces", width=600, height=400)))

Chhattisgarh displays