Skip to content

EMODnet/emodnet-bio-r-geo-tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EMODnet Biology R Geospatial Tutorials

Quarto Publish License: CC BY 4.0 License: MIT

A collection of R-based geospatial tutorials demonstrating how to access and analyze marine biological and environmental data from EMODnet Biology and other EMODnet thematic services using the emodnet.wfs and emodnet.wcs R packages.

Overview

These tutorials provide practical, reproducible workflows for working with EMODnet's Web Feature Service (WFS) and Web Coverage Service (WCS) data. They cover a range of marine spatial analysis scenarios, from basic data access to complex multi-source integrations.

Tutorials

  1. Detecting Overlaps Between Marine Protected Areas and Subsea Infrastructure - Uses emodnet.wfs to identify spatial overlaps between MPAs and human activities in the North Sea

  2. Accessing and Analyzing WCS Raster Layers - Demonstrates emodnet.wcs by exploring zooplankton distributions in relation to plaice nursery grounds

  3. Combining WFS and WCS Data - Integrates vector and raster data to investigate biodiversity change in relation to depth in the North Sea

  4. Integrating Multiple Data Sources - Advanced tutorial combining EMODnet services with Copernicus Marine Service data and trait databases to explore functional ecology in the Aegean Sea

Using These Tutorials

Online Access

The tutorials are available as an interactive website at: https://emodnet.github.io/emodnet-bio-r-geo-tutorials/

Prerequisites

To follow along with the tutorials, you'll need:

Required Knowledge:

  • Basic to intermediate R programming
  • Familiarity with geospatial concepts (vectors, rasters, coordinate reference systems)
  • Understanding of pipe operators (|> or %>%)

Software:

R Package Installation

The tutorials are bundled as an R package with helper functions and cached data. Installing the package from GitHub also pulls in every R dependency the tutorials need (including emodnet.wfs and emodnet.wcs, plus website-only extras), so this is a single one-liner:

# install pak if you don't have it
install.packages("pak")

# install the tutorials package and ALL dependencies
# (Imports + Suggests from DESCRIPTION, plus website-only deps)
pak::pak(
  "EMODnet/emodnet-bio-r-geo-tutorials",
  dependencies = c("all", "Config/Needs/website")
)

emodnet.wfs is on CRAN; emodnet.wcs is installed from the EMODnet/emodnet.wcs GitHub repository via the Remotes: field in DESCRIPTION. pak resolves both transparently.

Working With the Tutorials

For Learners: Running Tutorials Interactively

If you want to work through the tutorials in your own R environment:

  1. Clone the repository:

    git clone https://github.com/EMODnet/emodnet-bio-r-geo-tutorials.git
    cd emodnet-bio-r-geo-tutorials
  2. Install required packages (see R Package Installation above)

  3. Open tutorial files:

    • Tutorial files are in the tutorials/ directory (.qmd files)
    • Open them in RStudio or your preferred editor
    • Run code chunks interactively (Ctrl/Cmd + Enter)
  4. Work through at your own pace:

    • Code chunks can be run independently
    • Modify code to explore different scenarios
    • Create your own variations based on the examples

For Contributors: Building the Website Locally

If you want to preview the full website or contribute changes:

  1. Install Quarto (≥ 1.5): Download here

  2. Clone and setup:

    git clone https://github.com/EMODnet/emodnet-bio-r-geo-tutorials.git
    cd emodnet-bio-r-geo-tutorials
  3. Install R packages (see R Package Installation)

  4. Preview the site:

    quarto preview
    • Opens browser with live-reloading preview
    • Changes auto-refresh as you edit
  5. Build the site:

    quarto render
    • Generates site in _site/ directory
    • Check _site/index.html to verify build
  6. Refresh caches before submitting PRs:

    # Remove freeze cache and re-execute all code
    rm -rf _freeze/
    quarto render --cache-refresh
    
    # Or for a single tutorial
    rm -rf _freeze/tutorials/tutorial-01/
    quarto render tutorials/tutorial-01.qmd --cache-refresh

    This ensures tutorials run correctly with current package versions. See CONTRIBUTING.md for details on caching.

Troubleshooting Workflow Failures

If the CI/CD workflow fails:

1. Check the workflow run:

  • Click the badge: Quarto Publish
  • Review error messages in failed steps

2. Common issues:

  • R package errors: Package versions may have changed - update DESCRIPTION
  • EMODnet service issues: WFS/WCS endpoints may be temporarily down - check EMODnet status
  • Broken links: Check the "Check links with Lychee" step job summary
  • Render errors: Test locally with quarto render to reproduce

3. Broken links (scheduled runs):

  • Weekly checks create issues with label scheduled-check
  • Review and fix broken external links or update exclusions
  • Internal links usually indicate missing files or incorrect paths

4. Test locally first:

# Reproduce the CI environment
quarto render
# If successful locally but fails in CI, check package versions

5. Need help?

Contributing

We welcome contributions! Whether you want to:

  • Report a bug or suggest improvements
  • Add a new tutorial
  • Fix errors or improve documentation

Please see CONTRIBUTING.md for detailed guidelines on the contribution process.

License

This project uses a dual license:

See LICENSE for an overview and individual license files for full legal text.

Citation

If you use these tutorials in your research or teaching, please cite them using the information provided in our CITATION.cff file.

On GitHub: Click the "Cite this repository" button in the repository sidebar to get formatted citations in various styles (APA, BibTeX, etc.).

Manual citation format:

Krystalli, A. (2025). EMODnet Biology R Geospatial Tutorials [Data set].
https://github.com/EMODnet/emodnet-bio-r-geo-tutorials

Links

Contact & Support

Acknowledgements

The European Marine Observation and Data Network (EMODnet) is financed by the European Union under Regulation (EU) 2021/1139 of the European Parliament and of the Council of 7 July 2021 establishing the European Maritime, Fisheries and Aquaculture Fund. Ref: CINEA/EMFAF/2022/3.5.2/SI2.895681

Copyright © 2025 European Climate, Infrastructure and Environment Executive Agency (CINEA).

Reviewers

Thanks to Maëlle Salmon (@maelle) and Joana Beja (@JoBeja) for thorough review of the tutorials and supporting documentation.

About

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-MIT

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages