-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
147 lines (96 loc) · 3.99 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
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/README-",
out.width = "100%"
)
```
# FloraIberica
<!-- badges: start -->
[![R-CMD-check](https://github.com/Pakillo/FloraIberica/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Pakillo/FloraIberica/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/Pakillo/FloraIberica/branch/master/graph/badge.svg)](https://app.codecov.io/gh/Pakillo/FloraIberica?branch=master)
`r badger::badge_lifecycle("stable")`
`r badger::badge_repostatus("Active")`
[![HitCount](https://hits.dwyl.com/Pakillo/FloraIberica.svg?style=flat-square)](https://hits.dwyl.com/Pakillo/FloraIberica)
[![HitCount: unique users](https://hits.dwyl.com/Pakillo/FloraIberica.svg?style=flat-square&show=unique)](https://hits.dwyl.com/Pakillo/FloraIberica)
<!-- badges: end -->
`FloraIberica` R package facilitates access to taxonomic and distribution data for the c. 6500 vascular plants present in the Iberian Peninsula and Balearic Islands, based on the [AFLIBER database](https://doi.org/10.1111/geb.13363). This atlas provides the distribution of each taxon in a 10 x 10 km UTM grid.
## Installation
``` r
remotes::install_github("Pakillo/FloraIberica")
```
## Usage
```{r example}
library(FloraIberica)
```
### Checking if taxa are present in the Iberian Peninsula and/or Balearic Islands
```{r}
is_present(genus = "Laurus", species = c("nobilis", "azorica"))
```
### Checking if taxa are endemic
```{r}
is_endemic(genus = "Aconitum", species = "napellus",
subspecies = c("castellanum", "lusitanicum"))
```
### Getting the distribution of plant taxa
Returns sf or dataframe with the coordinates of the centre of 10 x 10 km UTM grid cells where taxa are present:
```{r}
get_distribution("Abies", "pinsapo")
```
### Making distribution maps
#### Single taxon
```{r laurus}
map_distribution(genus = "Laurus", species = "nobilis", size = 0.9)
```
#### Many taxa
Distribution of Iberian *Abies*:
```{r abies_together}
abies <- get_distribution("Abies")
map_distribution(abies)
```
You can also get one map per taxon (species):
```{r abies_facet}
map_distribution(abies, facet = TRUE, ncol = 1)
```
Or collapse all presences of the entire genus:
```{r abies_collapse}
map_distribution(abies, taxo.level = "genus", size = 0.9)
```
Another example with Iberian pines:
```{r pines, out.width="100%", fig.asp=1}
library(ggplot2)
map_distribution(genus = "Pinus", facet = TRUE, ncol = 2) +
theme(axis.text = element_text(size = 6))
```
### Get a checklist of the plants present near a point or polygon
If you want to know the plants near a given site, just pass the coordinates to [get_checklist](https://pakillo.github.io/FloraIberica/reference/get_checklist.html):
```{r}
site <- c(-5, 40)
head(get_checklist(site))
```
The site can be a polygon, so you can easily obtain a list of the plants present within a given area (e.g. town, province, natural reserve):
```{r cache = TRUE}
cadiz <- mapSpain::esp_get_prov_siane("Cadiz", epsg = "4326")
head(get_checklist(cadiz))
```
You can also obtain an `sf` object rather than a dataframe, so you know where each plant occurs within or near that polygon (with a resolution of 10x10 km inherited from the AFLIBER database):
```{r cadiz.qpyr, message=FALSE, cache = TRUE}
cadiz.qpyr <- get_checklist(cadiz, sf = TRUE) |>
dplyr::filter(Genus == "Quercus", Species == "pyrenaica")
ggplot() +
geom_sf(data = cadiz) +
geom_sf(data = cadiz.qpyr) +
theme_bw()
```
## Citation
```{r comment=NA}
citation("FloraIberica")
```
## Funding
The development of this software has been funded by Fondo Europeo de Desarrollo Regional (FEDER) and Consejería de Transformación Económica, Industria, Conocimiento y Universidades of Junta de Andalucía (proyecto US-1381388 led by Francisco Rodríguez Sánchez, Universidad de Sevilla).
![](man/figures/feder.png)