malariaAtlas

An R interface to open-access malaria data, hosted by the Malaria Atlas Project.

https://github.com/malaria-atlas-project/malariaatlas

Science Score: 23.0%

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

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    4 of 12 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.8%) to scientific vocabulary

Keywords

database malaria opendata r raster
Last synced: 6 months ago · JSON representation

Repository

An R interface to open-access malaria data, hosted by the Malaria Atlas Project.

Basic Info
Statistics
  • Stars: 48
  • Watchers: 6
  • Forks: 23
  • Open Issues: 17
  • Releases: 2
Topics
database malaria opendata r raster
Created almost 8 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.Rmd

---
output: 
  md_document:
    preserve_yaml: false
---

```{r, echo = FALSE, message = FALSE, results = "hide", warning = FALSE}
library(malariaAtlas)
library(tibble)

knitr::opts_chunk$set(fig.path = 'man/figures/')
```

# malariaAtlas

### An R interface to open-access malaria data, hosted by the Malaria Atlas Project.

*The gitlab version of the malariaAtlas package has some additional bugfixes over the stable CRAN package. If you have any issues, try installing the latest github version. See below for instructions.*

# Overview

This package allows you to download parasite rate data (*Plasmodium falciparum* and *P. vivax*), survey occurrence data of the 41 dominant malaria vector species, and modelled raster outputs from the [Malaria Atlas Project](https://malariaatlas.org/).

More details and example analyses can be found in the [published paper)[().

## Available Data: 
The data can be explored at [https://data.malariaatlas.org/maps](https://data.malariaatlas.org/maps).

### List Versions Functions

The list version functions are used to list the available versions of different datasets, and all return a data.frame with a single column for version. These versions can be passed to functions such as `listShp`, `listSpecies`, `listPRPointCountries`, `listVecOccPointCountries`, `getPR`, `getVecOcc` and `getShp`.

Use:

-   `listPRPointVerions()` to see the available versions for PR point data, which can then be used in `listPRPointCountries` and `getPR`.

-   `listVecOccPointVersions()` to see the available versions for vector occurrence data, which can then be used in `listSpecies`, `listVecOccPointCountries` and `getVecOcc`.

-   `listShpVersions()` to see the available versions for admin unit shape data, which can then be used in `listShp` and `getShp`.

```{r results = "hide", message = FALSE}
listPRPointVersions()
```

```{r results = "hide", message = FALSE}
listVecOccPointVersions()
```

```{r results = "hide", message = FALSE}
listShpVersions()
```

### List Countries and Species Functions

To list the countries where there is available data for PR points or vector occurrence points, use:

-   `listPRPointCountries()` for PR points
-   `listVecOccPointCountries()` for vector occurrence points

To list the species available for vector point data use `listSpecies()`

All three of these functions can optionally take a version parameter (which can be found with the list versions functions). If you choose not to provide a version, the most recent version of the relevant dataset will be selected by default.

```{r results = "hide", message = FALSE}
listPRPointCountries(version = "202206")
```

```{r results = "hide", message = FALSE}
listVecOccPointCountries(version = "201201")
```

```{r results = "hide", message = FALSE}
listSpecies(version = "201201")
```

### List Administrative Units

To list administrative units for which shapefiles are stored on the MAP geoserver, use `listShp()`. Similar to the list countries and species functions, this function can optionally take a version.

```{r results = "hide", message = FALSE}
listShp(version = "202206")
```

### List Raster Function

`listRaster()` gets minimal information on all available rasters. It returns a data.frame with several columns for each raster such as dataset_id, title, abstract, min_raster_year and max_raster_year. The dataset_id can then be used in `getRaster` and `extractRaster`.

```{r results = "hide", message = FALSE}
listRaster()
```

### Is Available Functions

`isAvailable_pr` confirms whether or not PR survey point data is available to download for a specified country, ISO3 code or continent.

Check whether PR data is available for Madagascar:

```{r results = "hide", message = FALSE}
isAvailable_pr(country = "Madagascar")
```

Check whether PR data is available for the United States of America by ISO code:

```{r results = "hide", message = FALSE}
isAvailable_pr(ISO = "USA")
```

Check whether PR data is available for Asia:

```{r results = "hide", message = FALSE}
isAvailable_pr(continent = "Asia")
```

`isAvailable_vec` confirms whether or not vector survey point data is available to download for a specified country, ISO3 code or continent.

Check whether vector data is available for Myanmar:

```{r results = "hide", message = FALSE}
isAvailable_vec(country = "Myanmar")
```

Check whether vector data is available for multiple countries:

```{r results = "hide", message = FALSE}
isAvailable_vec(country = c("Nigeria", "Ethiopia"))
```

You can also pass these functions a dataset version. If you don't they will default to using the most recent version.

```{r results = "hide", message = FALSE}
isAvailable_pr(country = "Madagascar", version = "202206")
```

## Downloading & Visualising Data:

### get\* functions & autoplot methods

### Parasite Rate Survey Points

`getPR()` downloads all publicly available PR data points for a specified location (country, ISO, continent or extent) and plasmodium species (Pf, Pv or BOTH) and returns this as a dataframe with the following format:

```{r message = FALSE, warning = FALSE, results = "hide"}
MDG_pr_data <- getPR(country = "Madagascar", species = "both")
```

```{r echo = FALSE}
tibble::glimpse(MDG_pr_data)
```

```{r message = FALSE}
Africa_pvpr_data <- getPR(continent = "Africa", species = "Pv")
```

```{r message = FALSE}
Extent_pfpr_data <- getPR(extent = rbind(c(-2.460181, 13.581921), c(-3.867188, 34.277344)), species = "Pf")
```

You can also pass this function a dataset version. If you don't it will default to using the most recent version.

```{r message = FALSE}
MDG_pr_data_202206 <- getPR(country = "Madagascar", species = "both", version = "202206")
```

`autoplot.pr.points` configures autoplot method to enable quick mapping of the locations of downloaded PR points.

```{r message = FALSE, warning = FALSE, results = "hide"}
autoplot(MDG_pr_data)
```

A version without facetting is also available.

```{r message = FALSE, warning = FALSE, results = "hide"}
autoplot(MDG_pr_data,
         facet = FALSE)
```

### Vector Survey Points

`getVecOcc()` downloads all publicly available Vector survey points for a specified location (country, ISO, continent or extent) and species (options for which can be found with `listSpecies`) and returns this as a dataframe with the following format:

```{r message = FALSE, warning = FALSE, results = "hide"}
MMR_vec_data <- getVecOcc(country = "Myanmar")
```

```{r echo = FALSE}
tibble::glimpse(MMR_vec_data)
```

You can also pass this function a dataset version. If you don't it will default to using the most recent version.

```{r message = FALSE, warning = FALSE, results = "hide"}
MMR_vec_data_201201 <- getVecOcc(country = "Myanmar", version = "201201")
```

`autoplot.vector.points` configures autoplot method to enable quick mapping of the locations of downloaded vector points.

```{r message = FALSE, warning = FALSE, results = "hide"}
autoplot(MMR_vec_data)
```

N.B. Facet-wrapped option is also available for species stratification.

```{r message = FALSE, warning = FALSE, results = "hide"}
autoplot(MMR_vec_data,
         facet = TRUE)
```

### Shapefiles

`getShp()` downloads a shapefile for a specified country (or countries) and returns this as a simple feature object.

```{r message = FALSE}
MDG_shp <- getShp(ISO = "MDG", admin_level = c("admin0", "admin1"))
```

```{r echo = FALSE}
tibble::glimpse(MDG_shp)
```

`autoplot.sf` configures autoplot method to enable quick mapping of downloaded shapefiles.

```{r message = FALSE}
autoplot(MDG_shp)
```

N.B. Facet-wrapped option is also available for species stratification.

```{r message = FALSE, warning = FALSE, results = "hide"}
autoplot(MDG_shp,
         facet = TRUE,
         map_title = "Example of facetted shapefiles.")
```

### Modelled Rasters

`getRaster()`downloads publicly available MAP rasters for a specific dataset_id & year, clipped to a given bounding box or shapefile

```{r message = FALSE, warning = FALSE, results = "hide"}
MDG_shp <- getShp(ISO = "MDG", admin_level = "admin0")
MDG_PfPR2_10 <- getRaster(dataset_id = "Explorer__2020_Global_PfPR", shp = MDG_shp, year = 2013)
```

`autoplot.SpatRaster` & `autoplot.SpatRasterCollection` configures autoplot method to enable quick mapping of downloaded rasters.

```{r message = FALSE}
p <- autoplot(MDG_PfPR2_10, shp_df = MDG_shp)
```

### Combined visualisation

By using the above tools along with ggplot, simple comparison figures can be easily produced.

```{r message = FALSE, warning = FALSE, results = "hide"}
MDG_shp <- getShp(ISO = "MDG", admin_level = "admin0")
MDG_PfPR2_10 <- getRaster(dataset_id = "Explorer__2020_Global_PfPR", shp = MDG_shp, year = 2013)

p <- autoplot(MDG_PfPR2_10, shp_df = MDG_shp, printed = FALSE)

pr <- getPR(country = c("Madagascar"), species = "Pf")
p[[1]] +
geom_point(data = pr[pr$year_start==2013,], aes(longitude, latitude, fill = positive / examined, size = examined), shape = 21)+
scale_size_continuous(name = "Survey Size")+
 scale_fill_distiller(name = "PfPR", palette = "RdYlBu")+
 ggtitle("Raw PfPR Survey points\n + Modelled PfPR 2-10 in Madagascar in 2013")
```

Similarly for vector survey data

```{r message = FALSE, warning = FALSE, results = "hide"}
MMR_shp <- getShp(ISO = "MMR", admin_level = "admin0")
MMR_An_dirus <- getRaster(dataset_id = "Explorer__2010_Anopheles_dirus_complex", shp = MMR_shp)

p <- autoplot(MMR_An_dirus, shp_df = MMR_shp, printed = FALSE)

vec <- getVecOcc(country = c("Myanmar"), species = "Anopheles dirus")
p[[1]] +
geom_point(data = vec, aes(longitude, latitude, colour = species))+
  scale_colour_manual(values = "black", name = "Vector survey locations")+
 scale_fill_distiller(name = "Predicted distribution of An. dirus complex", palette = "PuBuGn", direction = 1)+
 ggtitle("Vector Survey points\n + The predicted distribution of An. dirus complex")
```

## Installation

### Latest stable version from CRAN

Just install using `install.packages("malariaAtlas")` or using the package manager in RStudio.

### Latest version from github

While this version is not as well-tested, it may include additional bugfixes not in the stable CRAN version. Install the `devtools` package and then install using `devtools::install_github('malaria-atlas-project/malariaAtlas')`

Owner

  • Name: The Malaria Atlas Project
  • Login: malaria-atlas-project
  • Kind: organization
  • Email: map@ndph.ox.ac.uk
  • Location: Oxford, UK

GitHub Events

Total
  • Issues event: 2
  • Watch event: 4
  • Issue comment event: 3
  • Push event: 1
  • Fork event: 1
Last Year
  • Issues event: 2
  • Watch event: 4
  • Issue comment event: 3
  • Push event: 1
  • Fork event: 1

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 857
  • Total Committers: 12
  • Avg Commits per committer: 71.417
  • Development Distribution Score (DDS): 0.676
Past Year
  • Commits: 159
  • Committers: 5
  • Avg Commits per committer: 31.8
  • Development Distribution Score (DDS): 0.358
Top Committers
Name Email Commits
Tim Lucas t****s@g****m 278
Dan Pfeffer d****r@w****k 210
Suzanne Keddie s****k@n****k 116
Mauricio van den Berg m****g@t****u 102
Daniel Pfeffer d****r@b****k 81
sarahmconnor s****r@t****u 50
Mauricio van den Berg M****g@t****u 6
Daniel Pfeffer w****4@n****k 5
shk313 4****3 4
OJWatson o****n@h****k 2
Gerry Ryan g****n 2
Joe Harris j****s@t****u 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 48
  • Total pull requests: 20
  • Average time to close issues: 3 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 13
  • Total pull request authors: 7
  • Average comments per issue: 2.23
  • Average comments per pull request: 0.9
  • Merged pull requests: 20
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 2 days
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 1.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • timcdlucas (30)
  • Danpfeffer (5)
  • geryan (2)
  • justinmillar (2)
  • hanzhang0 (1)
  • haohanchen (1)
  • transferlearnings (1)
  • rsbivand (1)
  • OJWatson (1)
  • bertozzivill (1)
  • cruzmamo (1)
  • rjzupkoii (1)
  • RasmusKlinkJoerg (1)
Pull Request Authors
  • timcdlucas (9)
  • shk313 (3)
  • Danpfeffer (2)
  • OJWatson (2)
  • mauricio-tki (2)
  • joemap (1)
  • geryan (1)
Top Labels
Issue Labels
enhancement (6) docs (4) minor/refactor (3) bug (2) getPR (2) getRaster (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 769 last-month
  • Total docker downloads: 21,613
  • Total dependent packages: 0
  • Total dependent repositories: 5
  • Total versions: 13
  • Total maintainers: 1
cran.r-project.org: malariaAtlas

An R Interface to Open-Access Malaria Data, Hosted by the 'Malaria Atlas Project'

  • Versions: 13
  • Dependent Packages: 0
  • Dependent Repositories: 5
  • Downloads: 769 Last month
  • Docker Downloads: 21,613
Rankings
Forks count: 4.0%
Stargazers count: 8.2%
Dependent repos count: 13.3%
Average: 17.3%
Dependent packages count: 28.0%
Downloads: 33.0%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • ggplot2 * depends
  • curl * imports
  • dplyr * imports
  • grid * imports
  • gridExtra * imports
  • httr * imports
  • methods * imports
  • raster * imports
  • rgdal * imports
  • rlang * imports
  • sp * imports
  • stats * imports
  • stringi * imports
  • tidyr * imports
  • utils * imports
  • xml2 * imports
  • knitr * suggests
  • magrittr * suggests
  • palettetown * suggests
  • rdhs * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • tibble * suggests