Getting Started

The MERMAID R package (mermaidr) is designed to help you and collaborators efficiently access, analyze, and import coral reef monitoring data from the MERMAID platform—directly within the R environment. Whether you're working with large datasets across multiple sites, conducting advanced analyses, or integrating legacy data into your ongoing monitoring data, mermaidr streamlines your workflow.

What Can You Do with this R Package

With mermaidr, you can:

  • Access and export your project data from MERMAID for custom analysis.

  • Compile datasets from multiple projects or survey years.

  • Import historical or legacy datasets into your MERMAID projects.

  • Validate your data against MERMAID templates before import.

  • Leverage ready-made analysis code templates from the MERMAID analysis hub.

These features make mermaidr a valuable tool for those in the MERMAID community conducting analysis, as well as those seeking a smooth path for integrating their datasets into one platform.

Software Requirements

Before you begin, ensure that you have R and RStudio installed on your computer. 

Download R: https://cran.rstudio.com/

Download RStudio: https://posit.co/download/rstudio-desktop/

These programs provide the environment in which you will run the package mermaidr.

Installing mermaidr

Open RStudio. In the Console panel (bottom left by default), or in a new script file (top left), install the package mermaidr directly from GitHub:

#install package from GitHub 
install.packages("devtools") 
devtools::install_github("data-mermaid/mermaidr")
# or use the "remotes" package to install mermaidr
remotes::install_github("data-mermaid/mermaidr")

Then load the package:

#load package
library(mermaidr)

Visit the package website for detailed documentation, function references, and tutorials.  

For a full list of available functions: Function Reference

Authentication and Access Requirements

To use mermaidr, you must have a registered MERMAID account. You can sign up for free at app.datamermaid.org

When you run a data access function (e.g., mermaid_get_my_projects()), a browser window will automatically open prompting you to log in with your MERMAID credentials. Once authenticated, the package stores a temporary access token to authorize your session.

Note: Authentication is valid for 24 hours. After that, you will need to log in again when running a new function.

You can access:

  • Your own projects — all MERMAID projects that you are part of

  • Public projects — projects with data sharing policies set to public or public summary

This dual access allows you to:

  • Analyze your own project’s data

  • Aggregate data from across projects or countries

  • Conduct regional comparisons

  • Perform global syntheses using open-access coral reef data

Useful Resources