-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.qmd
136 lines (103 loc) · 3.85 KB
/
README.qmd
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
---
format: gfm
execute:
message: false
warning: false
eval: false
default-image-extension: ""
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# alboFr
<!-- badges: start -->
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=alboFr)
[](https://github.com/e-kotov/alboFr/actions/workflows/R-CMD-check.yaml)
[](https://doi.org/https://doi.org/10.5281/zenodo.14914417)
<!-- badges: end -->
The goal of `alboFr` is to retrieve the latest online data from [https://signalement-moustique.anses.fr/signalement_albopictus/colonisees](https://signalement-moustique.anses.fr/signalement_albopictus/colonisees){target="_blank"} and convert them into an `sf` object.
## Installation
You can install the development version of `alboFr` from R-universe with:
```r
install.packages("alboFr",
repos = c("https://e-kotov.r-universe.dev",
"https://cloud.r-project.org"
)
)
```
You can also install the development version of `alboFr` from [GitHub](https://github.com/e-kotov/alboFr) with:
```r
# install.packages("pak")
pak::pak("e-kotov/alboFr")
```
## Example with `sf` data type
The package only has one function to get the data:
```{r example}
library(alboFr)
x_sf <- get_tiger_mosquito_colonisation_in_france(output = "sf")
```
```{r}
head(x_sf)
```
```
Simple feature collection with 6 features and 1 field
Geometry type: POLYGON
Dimension: XY
Bounding box: xmin: 1.195249 ymin: 42.99451 xmax: 7.835923 ymax: 48.64427
Geodetic CRS: WGS 84
toujours_signaler geometry
1 TRUE POLYGON ((7.77076 48.49202,...
2 TRUE POLYGON ((1.987127 42.99451...
3 TRUE POLYGON ((1.584032 44.76673...
4 TRUE POLYGON ((1.249545 44.34751...
5 TRUE POLYGON ((2.566791 43.02245...
6 TRUE POLYGON ((3.502814 43.97531...
```
The data can then be plotted:
```{r plot}
library(ggplot2)
p <- ggplot(x_sf) +
geom_sf(aes(fill = toujours_signaler), col = NA) +
facet_wrap(~toujours_signaler)
p
# ggsave(
# filename = "man/figures/map.png",
# plot = p,
# width = 5,
# height = 4,
# units = "in",
# dpi = 300
# )
```
{width=100%}
Finally the data can be saved to a GeoPackage file:
```{r}
#| eval: false
library(sf)
st_write(x_sf, "tiger_mosquito_colonisation_in_france.gpkg")
```
## Example without `sf` data type
You do not have to have `sf` package installed to use {`alboFr`}. You can just retrieve the data in `geojson` format and save it directly to disk bypassing the `sf` object creation:
```{r}
x_geojson <- get_tiger_mosquito_colonisation_in_france(output = "geojson")
writeLines(x_geojson, "tiger_mosquito_colonisation_in_france.geojson")
```
## Data license
The original data does not have a well defined license, but the legal matters regarding this data can be found here: [https://signalement-moustique.anses.fr/signalement_albopictus/mentionslegales](https://signalement-moustique.anses.fr/signalement_albopictus/mentionslegales).
## Data archive
The data provider does not supply data versioning, but you can find the daily automatic snapshots of the data in this GitHub repository [https://github.com/e-kotov/alboFr-data-archive](https://github.com/e-kotov/alboFr-data-archive) or at Zenodo [https://doi.org/10.5281/zenodo.14914293](https://doi.org/10.5281/zenodo.14914293).
## Citation
```{r}
#| echo: false
#| results: asis
#| eval: true
print(citation("alboFr"), bibtex = FALSE)
```
BibTeX:
```
```{r}
#| echo: false
#| results: asis
#| eval: true
toBibtex(citation("alboFr"))
```
```