Yesterday i wrote about analyzing the SAP SuccessFactors Talent Hybrid integration Add-On download data. Today I mapped that data in Google Charts using the R package googleVis. This is how the data is visualized. The darker the region the more the downloads. I have embedded the interactive chart here. Move your cursor over the country to see the number of times the Talent Hybrid Add-on has been downloaded in that country.
Now let us see how this is done in R.
Step 1 is to import the data file into R
countrycount <- read.csv("country.csv")
The file country.csv has two columns. The first one is country names and the second one is number of downloads.
Step 2 is to set meaningful column names of the data frame.
names(countrycount)<- c("Country", "Downloads")
Step 3 is to tell the mapping package how to map the data.
Geo=gvisGeoMap(countrycount, locationvar="Country", numvar="Downloads",options=list(height=350, dataMode='regions'))
Step 4 is to plot the map.
plot(Geo)
Once you do this R will open a browser window and show you the interactive map.
Step 1 is to import the data file into R
countrycount <- read.csv("country.csv")
The file country.csv has two columns. The first one is country names and the second one is number of downloads.
Step 2 is to set meaningful column names of the data frame.
names(countrycount)<- c("Country", "Downloads")
Step 3 is to tell the mapping package how to map the data.
Geo=gvisGeoMap(countrycount, locationvar="Country", numvar="Downloads",options=list(height=350, dataMode='regions'))
Step 4 is to plot the map.
plot(Geo)
Once you do this R will open a browser window and show you the interactive map.
No comments:
Post a Comment