A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

mermaidr

An open-source data platform developed to help you collect, analyze, and share coral reef monitoring data.
https://github.com/data-mermaid/mermaidr

Category: Biosphere
Sub Category: Marine Life and Fishery

Last synced: about 19 hours ago
JSON representation

Repository metadata

R package for accessing MERMAID authenticated API endpoints

README.Rmd

          ---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%",
  message = FALSE,
  cache = FALSE
)

options(tibble.max_extra_cols = 20)
```
# mermaidr


[![R build status](https://github.com/data-mermaid/mermaidr/workflows/R-CMD-check/badge.svg)](https://github.com/data-mermaid/mermaidr/actions)


`mermaidr` is an R package that enables you to access data from [MERMAID](https://datamermaid.org/), an open-source data platform developed to help you collect, analyze, and share coral reef monitoring data. Through `mermaidr` you can access data from [MERMAID](https://collect.datamermaid.org/) directly in R.

For more information and detailed instructions on usage, please visit the [package website](https://data-mermaid.github.io/mermaidr/).

If you are new to the R programming language, our [new R users guide](https://data-mermaid.github.io/mermaidr/articles/new_to_r.html) is a great place to start! If you find yourself stuck, please don't hesitate to [ask for help](https://data-mermaid.github.io/mermaidr/articles/getting_help.html).

## Installation

You can install mermaidr from GitHub with:

``` r
# install.packages("remotes")
remotes::install_github("data-mermaid/mermaidr")
```

## Usage

Through `mermaidr`, you can access aggregated data from your coral reef surveys. To do this, first load the package and access your MERMAID projects:

```{r}
library(mermaidr)

projects <- mermaid_get_my_projects()
```

At this point, you will have to authenticate to the Collect app. R will help you do this automatically by opening a browser window for you to log in to Collect, either via Google sign-in or username and password - however you normally do! Once you've logged in, come back to R. Your login credentials will be stored for a day, until they expire, and you will need to log in again. The package handles the expiration for you, so just log in again when prompted.

This function gives us information on your projects, including project countries, the number of sites, tags, data policies, and more:

```{r}
projects
```

To focus on just one or a few projects, you can filter by fields like the project name, country, or tags using the `dplyr` package. For example, I'll narrow in on the WCS Mozambique Coral Reef Monitoring project.

```{r}
library(dplyr)

wcs_mozambique <- projects %>%
  filter(name == "WCS Mozambique Coral Reef Monitoring")
```

You can access data collected on fishbelt, benthic LIT, benthic PIT, bleaching, or habitat complexity - the main function to pull data related to your project is `mermaid_get_project_data()`:

```{r}
wcs_mozambique_fishbelt_samples <- wcs_mozambique %>%
  mermaid_get_project_data(method = "fishbelt", data = "sampleevents")
```

The `data = "sampleevents"` argument specifies that I'd like to pull data summarised to the level of a sample **event**, which is a site and date - we can see that this pulls information about the site and date of samples, along with aggregations like the total biomass of that site/date, and broken down by trophic group and fish family.

```{r}
wcs_mozambique_fishbelt_samples
```

If you'd like data related to the **units** of survey (for example, to transects or quadrats), it's just a matter of changing `data` to "sampleunits":

```{r}
wcs_mozambique %>%
  mermaid_get_project_data(method = "fishbelt", data = "sampleunits")
```

And raw observations are available by changing it to "observations":

```{r}
wcs_mozambique %>%
  mermaid_get_project_data(method = "fishbelt", data = "observations")
```

For more details on accessing project data, please see the [Accessing Project Data](https://data-mermaid.github.io/mermaidr/articles/accessing_project_data.html) article.

You may also want to access data that is not related to projects. To access this data, you do not need to authenticate R with MERMAID.

For example, you can pull reference data (the names and information of the fish and benthic attributes you can choose in MERMAID), using `mermaid_get_reference()`:

```{r}
mermaid_get_reference(reference = "fishfamilies")
```

Using this function, you can access the fish family, fish genera, fish species, and benthic attributes references by changing the `reference` argument.

You can also get a list of *all* projects (not just your own):

```{r}
mermaid_get_projects()
```

As well as all sites:

```{r}
mermaid_get_sites()
```

And all managements:

```{r}
mermaid_get_managements()
```

There is additional data available from the MERMAID API, both related to specific projects and not. If you think you'll need to use these, please see `mermaid_get_endpoint()` and `mermaid_get_project_endpoint()`.

This is a small sample of the wealth of data that's available on your MERMAID projects, and on the ecosystem as a whole! Please explore the [package website](https://data-mermaid.github.io/mermaidr/) for more.

        

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 7 days ago

Total Commits: 714
Total Committers: 3
Avg Commits per committer: 238.0
Development Distribution Score (DDS): 0.004

Commits in past year: 145
Committers in past year: 1
Avg Commits per committer in past year: 145.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Sharla Gelfand s****d@g****m 711
Kim Fisher s****i 2
Amkieltiela a****a@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 42
Total pull requests: 92
Average time to close issues: 3 months
Average time to close pull requests: 1 day
Total issue authors: 6
Total pull request authors: 2
Average comments per issue: 1.43
Average comments per pull request: 0.01
Merged pull request: 90
Bot issues: 0
Bot pull requests: 0

Past year issues: 11
Past year pull requests: 33
Past year average time to close issues: 22 days
Past year average time to close pull requests: 2 days
Past year issue authors: 3
Past year pull request authors: 1
Past year average comments per issue: 1.36
Past year average comments per pull request: 0.0
Past year merged pull request: 33
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/data-mermaid/mermaidr

Top Issue Authors

  • sharlagelfand (30)
  • esdarling (8)
  • Adizwiefler (1)
  • annacelis (1)
  • jpwrobinson (1)
  • lucysouthworth (1)

Top Pull Request Authors

  • sharlagelfand (91)
  • Amkieltiela (1)

Top Issue Labels

  • not ready on API (2)

Top Pull Request Labels


Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • curl * imports
  • dplyr * imports
  • fuzzyjoin * imports
  • glue * imports
  • httpuv * imports
  • httr * imports
  • jsonlite * imports
  • magrittr * imports
  • purrr * imports
  • rlang * imports
  • stringr * imports
  • tibble * imports
  • tidyr * imports
  • tidyselect * imports
  • usethis * imports
  • ggplot2 * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 2.1.0 suggests
  • tidyverse * suggests
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/check-standard.yaml actions
  • actions/checkout v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite

Score: 3.737669618283368