gridpresence

Transform counts to presence

https://github.com/robinilla/gridpresence

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.8%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Transform counts to presence

Basic Info
  • Host: GitHub
  • Owner: robinilla
  • License: agpl-3.0
  • Language: R
  • Default Branch: main
  • Size: 3.89 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 4
Created almost 2 years ago · Last pushed about 1 year ago
Metadata Files
Readme License Citation

README.md

gridPresence

Transform counts to presence

The gridPresence script transforms data counts to presence for a vectorial layer by intersecting both layers. If any of the count features that intersect with the presence features are greater than zero, presence feature will change to 1, otherwise it will remain as 0.

In the script folder it is provided a script (CountsSimulationAndTransformation) which transforms simulated count data into presence-only by using the gridPresence function. For running the script it could be downloaded the EEA 10 x 10 km grid (available here), and a 5 x 5 km grid can be generated, as in the example. Nonetheless, any other vector layer can be used instead of the proposed grids.

The below image summarises how the function works. Only presence transformation

There is also provided the script that describes the process of the simulation of the data provided in the Geopackage as polygon.layer.

R script files

  • The CountSimulationAndTransformation R script example file is prepared for transforming three years counts to 5 x 5 km grid (line 24), as well as 10 x 10 km grid. The transformation of the 5 x 5 km grid to the 10 x 10 km grid can be found at line 28. The function used for transforming hunting yields data to presence-only (gridPresence) is also provided (lines 46-93). An example of how to run the function for more than a year and for both grid resolutions is given as well (lines 97-105). Both results are given and plotted (lines 109-128). The R script file has been written in R 4.3.3 computing language and utilized the packages tidyverse 2.0.0 and sf 1.0-16.

  • Due to data confidentiality we could not provide real hunting yields to transform the information to presence we created the CreateRandomPolygonsInAExtent R script which provides the process to simulate count data in a spatial extent. We generated 2000 random polygons and three count surveys (lines 31-46). The count data followed a random Poisson distribution where the lambda parameter follows a random normal distribution (mean=50 and sd=10; lines 55-58). To simulate unkown presences, 25% of the polygons were randomly assigned a 0 value (lines 60-62). Finally, we exported the information as a vectorial layer in a Geopackage (lines 82-89).

References

  • R Core Team. R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria (2022).
  • Wickham, H. et al. Welcome to the Tidyverse. J Open Source Softw 4, 1686 (2019).
  • Pebesma, E. Simple Features for R: Standardized Support for Spatial Vector Data. R J 10, 439–446 (2018).
  • Hijmans, R. terra: Spatial Data Analysis. R package version 1.8-15, https://rspatial.github.io/terra/, https://rspatial.org/ (2025).
  • Hijmans, R., Phillips, S., Leathwick, J., Elith, J. dismo: Species Distribution Modeling. R package version 1.3-16, https://CRAN.R-project.org/package=dismo (2024).
  • Turner, R. deldir: Delaunay Triangulation and Dirichlet (Voronoi) Tessellation. R package version 2.0-4, https://CRAN.R-project.org/package=deldir (2024).

Citation

Illanas, S., Fernández-López, J., Vicente, J., Ruiz-Rodríguez, C., López-Padilla, S., Sebastián-Pardo, M., Preite, L., Gómez-Molina, A., Acevedo, P., Blanco-Aguiar, J.A. Presence-only data for wild ungulates and red fox in Spain based on hunting yields over a 10-year period. Sci Data 12, 236 (2025). https://doi.org/10.1038/s41597-025-04574-z

Owner

  • Login: robinilla
  • Kind: user

Citation (CITATION)

cff-version: 1.6.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Illanas"
  given-names: "Sonia"
  orcid: "https://orcid.org/0000-0001-7984-1141"
- family-names: "Fernández-López"
  given-names: "Javier"
  orcid: "https://orcid.org/0000-0003-4352-0252"
- family-names: "Vicente"
  given-names: "Joaquín"
  orcid: "https://orcid.org/0000-0001-8416-3672"
- family-names: "Ruiz-Rodríguez"
  given-names: "Carmen"
  orcid: "https://orcid.org/0000-0002-0768-9280"
- family-names: "López-Padila"
  given-names: "Sergio"
  orcid: "https://orcid.org/0000-0002-9663-4758"
- family-names: "Sebastián-Pardo"
  given-names: "Mario"
  orcid: "https://orcid.org/0009-0001-4629-7175"
- family-names: "Preite"
  given-names: "Ludovica"
  orcid: "https://orcid.org/0000-0003-4557-4326"
- family-names: "Gómez-Molina"
  given-names: "Azahara"
  orcid: "https://orcid.org/0009-0003-6323-498X"
- family-names: "Acevedo"
  given-names: "Pelayo"
  orcid: "https://orcid.org/0000-0002-3509-7696"
- family-names: "Blanco-Aguiar"
  given-names: "José Antonio"
  orcid: "https://orcid.org/0000-0003-4352-0252"
title: "gridPresence: v1.6.0. Simulated data set and function: Presence-only data for wild ungulates and red fox in Spain based on hunting yields."
version: 1.6.0
doi: 10.5281/zenodo.14767197
date-released: 2025-01-29
url: "https://github.com/robinilla/gridPresence" 
preferred-citation:
  type: article
  authors:
  - family-names: "Illanas"
    given-names: "Sonia"
    orcid: "https://orcid.org/0000-0001-7984-1141"
  - family-names: "Fernández-López"
    given-names: "Javier"
    orcid: "https://orcid.org/0000-0003-4352-0252"
  - family-names: "Vicente"
    given-names: "Joaquín"
    orcid: "https://orcid.org/0000-0001-8416-3672"
  - family-names: "Ruiz-Rodríguez"
    given-names: "Carmen"
    orcid: "https://orcid.org/0000-0002-0768-9280"
  - family-names: "López-Padila"
    given-names: "Sergio"
    orcid: "https://orcid.org/0000-0002-9663-4758"
  - family-names: "Sebastián-Pardo"
    given-names: "Mario"
    orcid: "https://orcid.org/0009-0001-4629-7175"
  - family-names: "Preite"
    given-names: "Ludovica"
    orcid: "https://orcid.org/0000-0003-4557-4326"
  - family-names: "Gómez-Molina"
    given-names: "Azahara"
    orcid: "https://orcid.org/0009-0003-6323-498X"
  - family-names: "Acevedo"
    given-names: "Pelayo"
    orcid: "https://orcid.org/0000-0002-3509-7696"
  - family-names: "Blanco-Aguiar"
    given-names: "José Antonio"
    orcid: "https://orcid.org/0000-0003-4352-0252"
  doi: 10.1038/s41597-025-04574-z
  journal: "Scientific Data"
  month: 2
  title: "Presence-only data for wild ungulates and red fox in Spain based on hunting yields over a 10-year period"
  issue: 12
  year: 2025

GitHub Events

Total
  • Release event: 6
  • Delete event: 2
  • Push event: 33
  • Create event: 6
Last Year
  • Release event: 6
  • Delete event: 2
  • Push event: 33
  • Create event: 6