Description Usage Arguments Value Note Author(s) References See Also Examples
An intensity map highlights regions or countries based on relative values.
The gvisIntensityMap function reads a data.frame and creates text output referring to the Google Visualisation API, which can be included into a web page, or as a stand-alone page.
1 2 | gvisIntensityMap(data, locationvar = "", numvar = "",
options = list(), chartid)
|
data |
a |
locationvar |
column name of |
numvar |
column names of |
options |
list of configuration options for Google Intensity Map.
Further possible components are, taken from https://google-developers.appspot.com/chart/interactive/docs/gallery/intensitymap.html#Configuration_Options:
|
chartid |
character. If missing (default) a random chart id will be generated based on
chart type and |
gvisIntensityMap
returns list of class
"gvis
" and "list
".
An object of class "gvis
" is a list containing at least the following components:
|
Google visualisation type, here 'IntensityMap' |
|
character id of the chart object. Unique chart ids are required to place several charts on the same page. |
|
a list with the building blocks for a page
|
Map images are generated using the Google Charts API (http://code.google.com/apis/chart/image/docs/gallery/map_charts.html). Please refer to the Chart API logging policy (http://code.google.com/apis/chart/interactive/faq.html#logging).
Markus Gesmann markus.gesmann@gmail.com,
Diego de Castillo decastillo@gmail.com
Google Intensity Map API: https://google-developers.appspot.com/chart/interactive/docs/gallery/intensitymap.html
Follow the link for Google's data policy.
See also print.gvis
, plot.gvis
for
printing and plotting methods, gvisMap
and gvisGeoMap
for an
alternative to gvisIntensityMap
.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Please note that by default the googleVis plot command
## will open a browser window and requires Internet
## connection to display the visualisation.
df=data.frame(country=c("US", "GB", "BR"), val1=c(1,3,4), val2=c(23,12,32))
Intensity1 <- gvisIntensityMap(df, locationvar="country", numvar=c("val1", "val2"))
plot(Intensity1)
## Set colours for each tab
Intensity2 <- gvisIntensityMap(df,
options=list(colors="['#4682b4', '#0073CF']"))
plot(Intensity2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.