catchment

Weighted Spatial Point Catchment Modelling

https://github.com/path-global-health/catchment

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
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

Weighted Spatial Point Catchment Modelling

Basic Info
  • Host: GitHub
  • Owner: PATH-Global-Health
  • License: other
  • Language: R
  • Default Branch: master
  • Size: 1.21 MB
Statistics
  • Stars: 6
  • Watchers: 9
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.Rmd

---
output: github_document
---



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

# catchment 





The goal of catchment is to estimate health facility catchment populations using Bayesian gravity models. The primary purpose of these population estimates is to calculate catchment-level incidence rates using routine reporting data from health information systems. 

## Installation

Before installing this package, first you will need to install the [R-INLA](https://www.r-inla.org/home) and [Template Model Builder (TMB)](https://github.com/kaskr/adcomp) packages. These packages are not on CRAN, and the installation process may depend on the type of computer you are using. I recommend following the [installation instructions for INLA]() first, and then install TMB. Be sure to close out of any active R session before installation!

The catchment package is also not on CRAN (yet!). You can install the development version of catchment from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("PATH-Global-Health/catchment")
```
## Example

We are currently developing documentation and tutorial materials. 

```{r, eval=FALSE}
# Load libraries
library(raster)
library(catchment)

# 1. Pre-processing --------------------------------------
## Load example dataset
data("example_shp")
data("example_pop")
data("example_locs")

## Get friction surface
fric <- PATHtools::get_friction_surface(example_shp) |> 
  raster::resample(example_pop, fun = "mean")

## Create output folder
f <- tempfile()
fs::dir_create(fs::path(f, "tt"))

# 2. Travel time and intial access surfaces --------------
## Create individual travel time rasters
create_travel_surface(friction_surface = fric, extent_file = example_pop,
  points = example_locs, id_col = "label", x_col = "x", y_col = "y",
  output_dir = fs::path(f, "tt"), individual_surfaces = T, parallel = T, cores = 5)

## Organize travel time matrix
tmat <- travel_mat_from_folder(dir = fs::path(f, "tt"), reference = example_pop)

## Create initial accessbility matrix
pmat <- initial_access_surface(tmat, n_fac_limit = 10, force_threshold = 300, sparse = F)

# 3. Fit catchment model ---------------------------------
## Organize input data
catch_dat <- prepare_data(prob_mat_init = pmat, pop_raster = example_pop,
  location_data = example_locs, mesh.args = list(cutoff = 0.1,max.edge = c(0.1, 4)))

## View INLA mesh
plot(catch_dat$mesh)
plot(example_shp, add = T, border = "red", lwd = 2)
points(example_locs$x, example_locs$y)

## Fit catchment model
mod <- catchment_model(catch_dat)

# 4. Post-processing -------------------------------------
## Estimated catchment populations
catchment_populations(mod)
example_locs$est_pop <- catchment_populations(mod)
```

Owner

  • Name: PATH
  • Login: PATH-Global-Health
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: "Millar"
    given-names: "Justin"
    orcid: "https://orcid.org/0000-0002-6866-7544"
  - family-names: "Arambepola"
    given-names: "Rohan"
title: "catchment: Weighted Spatial Point Catchment Modelling"
version: 0.0.0.9000
date-released: "2024-03-19"
url: "https://github.com/PATH-Global-Health/catchment"
abstract: "Create gravity-style catchment model for spatial point data, using individual weights and rasterized gridded data."
type: software
license: MIT 

GitHub Events

Total
  • Watch event: 2
  • Push event: 1
  • Fork event: 2
Last Year
  • Watch event: 2
  • Push event: 1
  • Fork event: 2