-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
121 lines (84 loc) · 4.32 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
117
118
119
120
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
message = FALSE,
warning = FALSE,
error = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# comoros: Datasets for use in designing surveys in the Comoros Union <img src="https://www.cia.gov/library/publications/the-world-factbook/attachments/flags/CN-flag.gif" width="200px" align="right" />
<!-- badges: start -->
[](https://www.tidyverse.org/lifecycle/#maturing)
[](https://travis-ci.org/spatialworks/comoros)
[](https://ci.appveyor.com/project/spatialworks/comoros)
[](https://www.codefactor.io/repository/github/spatialworks/comoros)
<!-- badges: end -->
Designing surveys require relevant datasets to be used as basis for sample size calculations, sampling design, survey planning/logistics and survey implementation. These include datasets on population, lists of sampling clusters, map datasets for spatial sampling, and previous survey datasets that can be used for estimating indicator variance and design effects. This package contains relevant datasets for use in designing surveys in the Comoros Union.
## Installation
The `comoros` package is not yet released on [CRAN](https://CRAN.R-project.org). The development version of the package can be installed from [GitHub](https://github.com/) with:
```{r install, echo = TRUE, eval = TRUE}
if(!require(remotes)) install.packages("remotes")
remotes::install_github("spatialworks/comoros")
```
## Usage
When installing `comoros`, geospatial packages on which `comoros` depends on are also installed. To use `comoros` package, it will be important to load these package dependencies that have been installed. This can be done by:
```{r depend, echo = TRUE, eval = TRUE}
library(rgdal)
library(rgeos)
library(raster)
```
### Country borders
The Comoros country borders `SpatialPolygonsDataFrame` is accessed via the `country` dataset.
```{r country1, echo = TRUE, eval = TRUE}
comoros::country
```
The country borders of the Comoros can be plotted by:
```{r country2, echo = TRUE, eval = TRUE, fig.align = "center", fig.width = 10, fig.height = 10, fig.retina = 1}
sp::plot(comoros::country)
```
### Island borders
The Comoros island borders `SpatialPolygonsDataFrame` is accessed via the `island` dataset.
```{r island1, echo = TRUE, eval = TRUE}
comoros::island
```
The island borders of the Comoros can be plotted by:
```{r island2, echo = TRUE, eval = TRUE, fig.align = "center", fig.width = 10, fig.height = 10, fig.retina = 1}
sp::plot(comoros::island)
```
### Prefecture borders
The Comoros prefecture borders `SpatialPolygonsDataFrame` is accessed via the `prefecture` dataset.
```{r prefecture1, echo = TRUE, eval = TRUE}
comoros::prefecture
```
The prefecture borders of the Comoros can be plotted by:
```{r prefecture2, echo = TRUE, eval = TRUE, fig.align = "center", fig.width = 10, fig.height = 10, fig.retina = 1}
sp::plot(comoros::prefecture)
```
### Commune borders
The Comoros commune borders `SpatialPolygonsDataFrame` is accessed via the `commune` dataset.
```{r commune1, echo = TRUE, eval = TRUE}
comoros::commune
```
The commune borders of the Comoros can be plotted by:
```{r commune2, echo = TRUE, eval = TRUE, fig.align = "center", fig.width = 10, fig.height = 10, fig.retina = 1}
sp::plot(comoros::commune)
```
### Populated places
Populated places in the Comoros can be accessed via the `ppl` dataset which is in a `SpatialPointsDataFrame` format.
```{r ppl1, echo = TRUE, eval = TRUE}
comoros::ppl
```
The populated places dataset can be laid over the country borders as follows:
```{r ppl2, echo = TRUE, eval = TRUE, fig.align = "center", fig.width = 10, fig.height = 10, fig.retina = 1}
sp::plot(comoros::commune, lwd = 0.5, border = "gray50")
sp::plot(comoros::prefecture, add = TRUE)
sp::plot(comoros::country, lwd = 2, add = TRUE)
sp::plot(comoros::ppl, cex = 0.3, pch = 20, col = "darkgreen", add = TRUE)
```