Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrc-ide/beers

:beers: :package: Beers Interpolation and Subdivision (my first R package)
https://github.com/mrc-ide/beers

demography interpolation subdivision

Last synced: 10 days ago
JSON representation

:beers: :package: Beers Interpolation and Subdivision (my first R package)

Awesome Lists containing this project

README

        

---
output: github_document
title: Beers
---

# beers

[![R build status](https://github.com/mrc-ide/beers/workflows/R-CMD-check/badge.svg)](https://github.com/mrc-ide/beers/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/mrc-ide/beers/master.svg)](https://codecov.io/github/mrc-ide/beers?branch=master)

```{r, echo = FALSE}
library(beers)
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```

## Introduction

The beers package provides the Beers ordinary and modified methods for interpolating
between 5-yearly points, and subdividing 5-yearly agebands. The most likely usage is
with demographic data that has been presented at 5-yearly intervals, or in 5-yearly
age-bands. The Beers algorithm can be used to interpolate, or subdivide those data
respectively, and is notably used by UNWPP for that purpose.

## Usage

Four functions provide interpolation or subdivision, with the ordinary or modified
Beers method. For interpolation, the algorithm requires at least 6 points, and for
subdivision at least 5 points.

```{r example}
beers_int_ordinary(c(1, 2, 4, 8, 16, 32))
beers_int_modified(c(1, 2, 4, 8, 16, 32))
beers_sub_ordinary(c(10, 20, 40, 80, 160))
beers_sub_modified(c(10, 20, 40, 80, 160))
```

## Installation

You can install beers from github with:

```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("mrc-ide/beers")
```

## License

MIT + file LICENSE © [Wes Hinsley](https://github.com/weshinsley).