knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(myMap)
myMap is a package implementing an R6 class constructor to download a map from Stamen API:[http://maps.stamen.com].
The constructor consists of 3 public methods and a private method. initialize method starts the function as it is called with the appropriate arguments. ## Call
A new object will be generated as the constructor ic called:
myMap = MapStamen$new(left = -124.409591, bottom = 32.534156, right = -114.131211, top = 42.009518, mapType = "terrain-background", Zoom = 8)
This call generates a new object named "myMap" which is actually a map extracted from Stamen API.
A map which is aimed be extracted from Stamen should be defined by a box. The coordinates of the lower-left and upper-right points of the box should therefor be passed as the arguments.
left: Provides the lower-left longtitude of the box. bottom: Provides the lower-left latitude of the box. right: Provides the upper-right longitude. top: Provides the upper-right latitude.mapType: Provides the type of interest for map to be extracted out. It can be one of the following: "terrain", "terrain-background", "terrain-labels", "terrain-lines", "toner", "toner-2010", "toner-2011", "toner-background", "toner-hybrid", "toner-labels", "toner-lines", "toner-lite", "watercolor" .
Each of these types will show a special characteristic of the area of interest. For the details see:[http://maps.stamen.com]
Zoom: Provides the zoom level.
This method will show the myMap:
myMap$showMap()
This is the map of the area of interest for the mapType = "terrain-background".
If we set mapType = "terrain":
myMap = MapStamen$new(left = -124.409591, bottom = 32.534156, right = -114.131211, top = 42.009518, mapType = "terrain", Zoom = 8) myMap$showMap()
This method will save a png file of myMap in the working directory:
myMap$saveMap()
This method display the No. of healthy days in California in 2019:
myMap$ClGoodday()
This method display the No. of moderate days in California in 2019:
myMap$ClModday()
This method display the No. of unhealthy days in California in 2019:
myMap$ClUnhealthyDay()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.