-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
100 lines (74 loc) · 3.38 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
---
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%"
)
```
# testmap
<!-- badges: start -->
[![Lifecycle: superseded](https://img.shields.io/badge/lifecycle-superseded-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html#superseded)
[![pkgdown](https://github.com/darrennorris/testmap/workflows/pkgdown/badge.svg)](https://github.com/darrennorris/eprdados/actions)
[![R-CMD-check](https://github.com/darrennorris/testmap/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/darrennorris/testmap/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
**testmap has moved to TACAR. Please check the newest advances here:
https://github.com/darrennorris/TACAR .**
The goal of testmap is to map future population changes of
the Yellow-spotted river turtle (*Podocnemis unifilis*).
The predicted future changes are from female-only,
stochastic stage-based matrix population projection models, developed here:
https://github.com/darrennorris/TACAR
## Objectives
These maps are being used to
- Provide an updated assesment of how threatened the species is.
- Inform development of and implement improvements to the modelling process.
## Results
Summaries of the results including maps of the projected future changes
can be found online.
- 3 generation.
Predicted changes after 35 years: https://darrennorris.github.io/testmap/articles/Interactive-map.html
## Installation
You can download the data to check and visualise using R.
testmap cannot be submitted to CRAN as the data files are large and the package
does not therefore pass "cran" checks.
So you need to install testmap like so:
``` r
install.packages("remotes")
remotes::install_github("darrennorris/testmap")
```
## Example
This example shows a summary of
future changes to *Podocnemis unifilis* populations in different countries.
Another example showing where *Podocnemis unifilis* is
Endangered is here:
https://darrennorris.github.io/testmap/articles/testmap.html
```{r example, warning=FALSE, message=FALSE}
library(testmap)
library(dplyr)
## Summary by country.
points_bau_ffr |>
dplyr::mutate(flag_EN = if_else(fem_diff_t35 <= -0.5, 1, 0)) |>
dplyr::group_by(COUNTRY) |>
dplyr::summarise(pop_start = sum(fem_t0),
pop_end = sum(fem_t35),
pop_change = round(((sum(fem_t35) - sum(fem_t0)) / sum(fem_t0)), 3),
length_river = n(),
length_endangered = sum((flag_EN))) |>
dplyr::ungroup() |>
dplyr::mutate(proportion_endangered = round((length_endangered / length_river), 2)) |>
dplyr::mutate(threat_status = case_when(pop_change <= -0.8 ~ "Critically Endangered",
pop_change <= -0.5 ~ "Endangered",
pop_change <= -0.3 ~ "Vulnerable",
pop_change <= -0.2 ~ "Near Threatened"))
```
Package developed and built using the following guides:
* Fan Wang: https://fanwangecon.github.io/PkgTestR/articles/ffv_pkgdown_github.html
and
* Emil Hvitfeldt: https://emilhvitfeldt.com/post/2018-09-02-usethis-workflow-for-package-development/
and
* Saskia O: https://www.marinedatascience.co/blog/2020/01/09/checklist-for-r-package-re-submissions-on-cran/