-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
116 lines (70 loc) · 3.18 KB
/
README.Rmd
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/",
out.width = "100%"
)
```
# robinmap
<!-- badges: start -->
[![R CMD Check](https://github.com/frbcesab/robinmap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/frbcesab/robinmap/actions/workflows/R-CMD-check.yaml)
[![Website deployment](https://github.com/frbcesab/robinmap/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/frbcesab/robinmap/actions/workflows/pkgdown.yaml)
[![License: GPL (>= 2)](https://img.shields.io/badge/License-GPL%20%28%3E%3D%202%29-blue.svg)](https://choosealicense.com/licenses/gpl-2.0/)
[![LifeCycle](man/figures/lifecycle/lifecycle-stable.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
<!-- badges: end -->
The goal of the R package `robinmap` is to map World countries in the Robinson
projection system (or others CRS) and to center the map on a different meridian
than Greenwich. It uses the [Natural Earth](https://www.naturalearthdata.com/) layer
as a base map.
![](man/figures/robinson_map.png)
![](man/figures/robinson_map_bis.png)
![](man/figures/eckert_map.png)
![](man/figures/mollweide_map.png)
![](man/figures/behrmann_map.png)
### System Requirements
This package handles spatial objects and requires some system dependencies
(GDAL, PROJ and GEOS). Please visit [this page](https://github.com/r-spatial/sf/#installing) to
correctly install these tools.
## Installation
You can install the development version from [GitHub](https://github.com/) with:
```{r eval = FALSE}
# install.packages("remotes")
remotes::install_github("FRBCesab/robinmap")
```
Then you can attach the package `robinmap`:
```{r eval = FALSE}
library("robinmap")
```
## Usage
```{r eval = FALSE}
## Default map ----
robinmap()
## Robinson projection - Pacific-centered ----
robinmap(center = 160)
## Robinson projection - Pacific-centered (export layer) ----
world <- robinmap(center = 160)
sf::st_write(world, "world_layer_pacific_centered.gpkg")
## World Eckert IV projection - Pacific-centered ----
eckert <- "+proj=eck4 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
robinmap(center = 160, crs = eckert)
## Mollweide projection - Pacific-centered ----
mollweide <- "+proj=moll +lon_0=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs"
robinmap(center = 160, crs = mollweide)
## Behrmann projection - Pacific-centered ----
behrmann <- "+proj=cea +lon_0=0 +lat_ts=30 +x_0=0 +y_0=0 +datum=WGS84 +ellps=WGS84 +units=m +no_defs"
robinmap(center = 160, crs = behrmann)
```
## Citation
Please cite this package as:
> Casajus Nicolas (`r format(Sys.Date(), "%Y")`) robinmap: World Map in
Pacific-centered Robinson Projection. R package version 1.0.
## Code of Conduct
Please note that the `robinmap` project is released with a
[Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.