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.

Arguments

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.

Methods

showMap()

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()

saveMap()

This method will save a png file of myMap in the working directory:

myMap$saveMap()

ClGoodday()

This method display the No. of healthy days in California in 2019:

myMap$ClGoodday()

ClModday()

This method display the No. of moderate days in California in 2019:

myMap$ClModday()

ClUnhealthyDay()

This method display the No. of unhealthy days in California in 2019:

myMap$ClUnhealthyDay()


alieti/myMap documentation built on Nov. 2, 2019, 1:40 p.m.