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: 3 months ago
JSON representation
:beers: :package: Beers Interpolation and Subdivision (my first R package)
- Host: GitHub
- URL: https://github.com/mrc-ide/beers
- Owner: mrc-ide
- License: other
- Created: 2018-01-29T16:43:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-12-09T16:32:02.000Z (over 4 years ago)
- Last Synced: 2025-02-16T03:17:17.783Z (5 months ago)
- Topics: demography, interpolation, subdivision
- Language: R
- Homepage:
- Size: 431 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
title: Beers
---# beers
[](https://github.com/mrc-ide/beers/actions)
[](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).