Description Usage Arguments Value Author(s) Examples
View source: R/addGraticules.R
This function adds graticules (parallels and meridians) to a map and returns axes labels and coordinates.
1 2 3 4 5 6 7 8 9 |
prj |
string the CRS of the map in the PROJ4 standard. |
parallels |
numeric vector of latitudes to add parallels. |
meridians |
numeric vector of longitudes to add meridians. |
line.color |
string color of graticules. |
line.size |
numeric width of graticules. |
line.type |
integer type of graticules. |
add |
boolean If TRUE, graticules are added to the map. |
This function returns a 2-elements list.
A first data frame for the meridians with 4 columns:
x: the x-coordinates of meridians
y: the y-coordinates of meridians
label: the labels of meridians (in degrees)
direction: the direction, i.e. W(est) or E(ast)
A second data frame for the parallels with 4 columns:
x: the x-coordinates of parallels
y: the y-coordinates of parallels
label: the labels of parallels (in degrees)
direction: the direction, i.e. S(outh) or N(orth)
Nicolas CASAJUS, nicolas.casajus@fondationbiodiversite.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | library(maps)
maps::map()
addGraticules(
prj = "+init=epsg:4326",
add = TRUE
)
## [[1]]
## x y label direction
## 1 -160 -90.00 160 W
## 2 -120 -89.95 120 W
## 3 -80 -89.90 80 W
## 4 -40 -89.85 40 W
## 5 0 -89.80 0
## 6 40 -89.75 40 E
## 7 80 -89.70 80 E
## 8 120 -89.65 120 E
## 9 160 -89.60 160 E
## [[2]]
## x y label direction
## 1 -180.0 -60 60 S
## 2 -179.9 -30 30 S
## 3 -179.8 0 0
## 4 -179.7 30 30 N
## 5 -179.6 60 60 N
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.