Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.6%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: OlisaNsonwu
- License: gpl-3.0
- Language: C++
- Default Branch: master
- Size: 71.4 MB
Statistics
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 13
Created almost 7 years ago
· Last pushed about 1 year ago
Metadata Files
Readme
Changelog
License
README.Rmd
---
output: github_document
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# diyar
[](https://cran.r-project.org/package=diyar)
[](https://www.r-pkg.org/pkg/diyar)
[](https://app.codecov.io/github/OlisaNsonwu/diyar?branch=master)
[](https://app.travis-ci.com/github/OlisaNsonwu/diyar)
## Installation
```{r eval = FALSE}
# Install the latest CRAN release
install.packages("diyar")
# Or, install the development version from GitHub
install.packages("devtools")
devtools::install_github("OlisaNsonwu/diyar")
```
## Overview
`diyar` is an `R` package for linking records with shared characteristics.
The linked records represent an entity, which depending on the context of the analysis can be unique patients,
infection episodes, overlapping periods of care, clusters or other occurrences as defined by a case definition. This makes it useful in ordinarily complex analyses such as record linkage,
contact or network analyses e.t.c.
The main functions are `links()`, `episodes()` and `partitions()`.
They are flexible in regards to how they compare records, as well as what are considered matches.
Their functionality can sometimes overlap however, each is better suited to particular use cases:
+ `links()` - link records with no relevance to an index record. For example, deterministic record linkage
+ `episodes()` - link records in relation to an index record. For example, contact and network analysis.
+ `partitions()` - link records in relation to a fixed interval.
## links()
**Key features;**
+ multi-stage record linkage. Here, multiple linkage criteria are assessed in a specified order of priority.
```{r warning = FALSE}
library(diyar)
data(missing_staff_id)
dfr_stages <- missing_staff_id[c("age", "hair_colour", "branch_office")]
priority_order_1 <- c("hair_colour", "branch_office")
priority_order_2 <- c("branch_office", "hair_colour")
dfr_stages$id.1 <- links(criteria = as.list(dfr_stages[priority_order_1]))
dfr_stages$id.2 <- links(criteria = as.list(dfr_stages[priority_order_2]))
```
+ create and use complex rules for record matching. This is done with a `sub_criteria()`.
```{r warning = FALSE}
sub.cri.1 <- sub_criteria(
hair.color = dfr_stages$hair_colour,
age = dfr_stages$age,
match_funcs = c(
"exact" = exact_match,
"age.range" = range_match)
)
last_word_wf <- function(x) tolower(gsub("^.* ", "", x))
last_word_cmp <- function(x, y) last_word_wf(x) == last_word_wf(y)
not_equal <- function(x, y) x != y
sub.cri.2 <- sub_criteria(
dfr_stages$branch_office,
dfr_stages$age,
match_funcs = c(
"last.word" = last_word_cmp,
"not.equal" = not_equal)
)
sub.cri.3 <- sub_criteria(sub.cri.1, sub.cri.2, operator = "and")
sub.cri.1
sub.cri.2
sub.cri.3
dfr_stages$id.3 <- links(
criteria = "place_holder",
sub_criteria = list("cr1" = sub.cri.3)
)
dfr_stages
```
There are variations of `links()` like `links_wf_probabilistic()` and `links_af_probabilistic()` for specific use cases such as probabilistic record linkage.
## episodes()
**Key features;**
+ link records within a specified period from an index record.
```{r warning = FALSE}
dfr_2 <- data.frame(date = as.Date("2020-01-01") + c(1:5, 10:15, 20:25))
dfr_2$id.1 <- episodes(
date = dfr_2$date, case_length = 2,
episodes_max = 1)
```
+ change the index record.
```{r warning = FALSE}
dfr_2$pref <- c(rep(2, 8), 1, rep(2, 8))
dfr_2$id.2 <- episodes(
date = dfr_2$date, case_length = number_line(-2, 2),
episodes_max = 1,
custom_sort = dfr_2$pref)
```
+ add a recurrence period
```{r warning = FALSE}
dfr_2$id.3 <- episodes(
date = dfr_2$date, case_length = number_line(-2, 2),
episode_type = "rolling", recurrence_length = 1,
episodes_max = 1, rolls_max = 1)
```
+ link overlapping periods
```{r warning = FALSE}
dfr_2$period <- number_line(dfr_2$date, dfr_2$date + 5)
dfr_2$id.4 <- episodes(
date = dfr_2$period, case_length = index_window(dfr_2$period),
episodes_max = 1)
dfr_2
```
There are variations of `episodes()` like `episodes_wf_splits()` for specific use cases such as more efficient handling of duplicate records.
## partitions()
**Key features;**
+ link all records within a specific periods in time
```{r warining = FALSE}
dfr_3 <- dfr_2["date"]
dfr_3$id.1 <- partitions(
date = dfr_3$date,
window = number_line(as.Date(c("2020-01-10", "2020-01-17")),
as.Date(c("2020-01-12", "2020-01-24")))
)
```
+ link all records within a splits of an interval
```{r warining = FALSE}
dfr_3$id.2 <- partitions(date = dfr_3$date, by = 3, separate = TRUE)
dfr_3$id.3 <- partitions(date = dfr_3$date, length.out = 3, separate = TRUE)
dfr_3
```
Find out more!
+ number_line and overlaps - `vignette("number_line")`
+ Introduction to epidemiological case definitions with diyar - `vignette("episodes")`
+ Introduction to record linkage with diyar - `vignette("links")`
+ Divvy up events with partitions - `vignette("panes")`
## Bugs and issues
Please report any bug or issues with using this package [here](https://github.com/OlisaNsonwu/diyar/issues).
Owner
- Login: OlisaNsonwu
- Kind: user
- Repositories: 2
- Profile: https://github.com/OlisaNsonwu
GitHub Events
Total
- Push event: 5
- Fork event: 1
Last Year
- Push event: 5
- Fork event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| OlisaNsonwu | 4****u | 278 |
| Olisa | o****u@g****m | 227 |
| Olisaeloka Nsonwu | O****u@p****k | 14 |
| Olisaeloka Nsonwu | O****u@u****k | 4 |
Committer Domains (Top 20 + Academic)
ukhsa.gov.uk: 1
phe.gov.uk: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 7
- Total pull requests: 14
- Average time to close issues: 3 days
- Average time to close pull requests: 2 minutes
- Total issue authors: 3
- Total pull request authors: 1
- Average comments per issue: 1.29
- Average comments per pull request: 0.0
- Merged pull requests: 14
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- OlisaNsonwu (5)
- dennis-wollersheim (1)
- tedmoorman (1)
Pull Request Authors
- OlisaNsonwu (14)
Top Labels
Issue Labels
enhancement (2)
bug (2)
cosmetic (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 722 last-month
- Total docker downloads: 20,392
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 13
- Total maintainers: 1
cran.r-project.org: diyar
Record Linkage and Epidemiological Case Definitions in 'R'
- Homepage: https://olisansonwu.github.io/diyar/index.html
- Documentation: http://cran.r-project.org/web/packages/diyar/diyar.pdf
- License: GPL-3
-
Latest release: 0.5.1
published over 2 years ago
Rankings
Forks count: 21.9%
Stargazers count: 22.5%
Average: 27.9%
Downloads: 29.7%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Maintainers (1)
Last synced:
11 months ago
Dependencies
revdep/library/diyar/new/isoband/DESCRIPTION
cran
- grid * imports
- utils * imports
- covr * suggests
- ggplot2 * suggests
- knitr * suggests
- magick * suggests
- microbenchmark * suggests
- rmarkdown * suggests
- sf * suggests
- testthat * suggests
- xml2 * suggests
DESCRIPTION
cran
- Rfast * imports
- ggplot2 * imports
- methods * imports
- rlang * imports
- utils * imports
- covr * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat * suggests
revdep/library/diyar/new/R6/DESCRIPTION
cran
- R >= 3.0 depends
- ggplot2 * suggests
- knitr * suggests
- microbenchmark * suggests
- pryr * suggests
- scales * suggests
- testthat * suggests
revdep/library/diyar/new/Rcpp/DESCRIPTION
cran
- methods * imports
- utils * imports
- inline * suggests
- pkgKitten >= 0.1.2 suggests
- rbenchmark * suggests
- tinytest * suggests
revdep/library/diyar/new/Rcpp/tinytest/testRcppClass/DESCRIPTION
cran
- R >= 2.15.0 depends
- Rcpp >= 0.8.5 imports
- methods * imports
revdep/library/diyar/new/Rcpp/tinytest/testRcppInterfaceExporter/DESCRIPTION
cran
- R >= 3.1.0 depends
- Rcpp * imports
revdep/library/diyar/new/Rcpp/tinytest/testRcppInterfaceUser/DESCRIPTION
cran
- R >= 3.1.0 depends
- Rcpp * imports
revdep/library/diyar/new/Rcpp/tinytest/testRcppModule/DESCRIPTION
cran
- Rcpp >= 0.8.5 depends
- methods * depends
revdep/library/diyar/new/Rcpp/tinytest/testRcppPackage/DESCRIPTION
cran
- Rcpp * imports
revdep/library/diyar/new/RcppArmadillo/DESCRIPTION
cran
- R >= 3.3.0 depends
- Rcpp >= 0.11.0 imports
- methods * imports
- stats * imports
- utils * imports
- Matrix >= 1.3.0 suggests
- pkgKitten * suggests
- reticulate * suggests
- slam * suggests
- tinytest * suggests
revdep/library/diyar/new/RcppZiggurat/DESCRIPTION
cran
- R >= 3.0.0 depends
- Rcpp * imports
- graphics * imports
- parallel * imports
- stats * imports
- utils * imports
- knitr * suggests
- lattice * suggests
- microbenchmark * suggests
- pinp * suggests
- rbenchmark * suggests
- rmarkdown * suggests
revdep/library/diyar/new/Rfast/DESCRIPTION
cran
- R >= 3.5.0 depends
- Rcpp >= 0.12.3 depends
- RcppZiggurat * depends
revdep/library/diyar/new/cli/DESCRIPTION
cran
- R >= 2.10 depends
- glue * imports
- methods * imports
- utils * imports
- callr * suggests
- covr * suggests
- grDevices * suggests
- htmlwidgets * suggests
- knitr * suggests
- mockery * suggests
- prettycode >= 1.1.0 suggests
- ps >=1.3.4.9000 suggests
- rmarkdown * suggests
- rstudioapi * suggests
- testthat * suggests
- withr * suggests
revdep/library/diyar/new/colorspace/DESCRIPTION
cran
- R >= 3.0.0 depends
- methods * depends
- grDevices * imports
- graphics * imports
- stats * imports
- KernSmooth * suggests
- MASS * suggests
- RColorBrewer * suggests
- datasets * suggests
- dplyr * suggests
- ggplot2 * suggests
- grid * suggests
- jpeg * suggests
- kernlab * suggests
- knitr * suggests
- mvtnorm * suggests
- png * suggests
- rcartocolor * suggests
- rmarkdown * suggests
- scales * suggests
- scico * suggests
- shiny * suggests
- shinyjs * suggests
- tcltk * suggests
- utils * suggests
- vcd * suggests
- viridis * suggests
- wesanderson * suggests
revdep/library/diyar/new/crayon/DESCRIPTION
cran
- grDevices * imports
- methods * imports
- utils * imports
- mockery * suggests
- rstudioapi * suggests
- testthat * suggests
- withr * suggests
revdep/library/diyar/new/digest/DESCRIPTION
cran
- R >= 3.3.0 depends
- utils * imports
- knitr * suggests
- minidown * suggests
- rmarkdown * suggests
- tinytest * suggests
revdep/library/diyar/new/diyar/DESCRIPTION
cran
- R >= 3.5.0 depends
- Rfast * imports
- ggplot2 * imports
- grDevices * imports
- graphics * imports
- methods * imports
- rlang * imports
- utils * imports
- covr * suggests
- knitr * suggests
- rmarkdown * suggests
- stringdist * suggests
- testthat * suggests
revdep/library/diyar/new/ellipsis/DESCRIPTION
cran
- R >= 3.2 depends
- rlang >= 0.3.0 imports
- covr * suggests
- testthat * suggests
revdep/library/diyar/new/fansi/DESCRIPTION
cran
- R >= 3.1.0 depends
- knitr * suggests
- rmarkdown * suggests
- unitizer * suggests
revdep/library/diyar/new/farver/DESCRIPTION
cran
- covr * suggests
- testthat >= 2.1.0 suggests
revdep/library/diyar/new/ggplot2/DESCRIPTION
cran
- R >= 3.2 depends
- sp * enhances
- MASS * imports
- digest * imports
- glue * imports
- grDevices * imports
- grid * imports
- gtable >= 0.1.1 imports
- isoband * imports
- mgcv * imports
- rlang >= 0.3.0 imports
- scales >= 0.5.0 imports
- stats * imports
- tibble * imports
- withr >= 2.0.0 imports
- Hmisc * suggests
- RColorBrewer * suggests
- covr * suggests
- dplyr * suggests
- ggplot2movies * suggests
- hexbin * suggests
- knitr * suggests
- lattice * suggests
- mapproj * suggests
- maps * suggests
- maptools * suggests
- multcomp * suggests
- munsell * suggests
- nlme * suggests
- profvis * suggests
- quantreg * suggests
- rgeos * suggests
- rmarkdown * suggests
- rpart * suggests
- sf >= 0.7 suggests
- svglite >= 1.2.0.9001 suggests
- testthat >= 2.1.0 suggests
- vdiffr >= 0.3.0 suggests
revdep/library/diyar/new/glue/DESCRIPTION
cran
- R >= 3.2 depends
- methods * imports
- DBI * suggests
- R.utils * suggests
- RSQLite * suggests
- covr * suggests
- crayon * suggests
- dplyr * suggests
- forcats * suggests
- ggplot2 * suggests
- knitr * suggests
- magrittr * suggests
- microbenchmark * suggests
- rmarkdown * suggests
- rprintf * suggests
- stringr * suggests
- testthat * suggests
- vctrs >= 0.3.0 suggests
- withr * suggests
revdep/library/diyar/new/labeling/DESCRIPTION
cran
- graphics * imports
- stats * imports
revdep/library/diyar/new/lifecycle/DESCRIPTION
cran
- R >= 3.3 depends
- glue * imports
- rlang >= 0.4.10 imports
- covr * suggests
- crayon * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat >= 3.0.1 suggests
- tibble * suggests
revdep/library/diyar/new/magrittr/DESCRIPTION
cran
- covr * suggests
- knitr * suggests
- rlang * suggests
- rmarkdown * suggests
- testthat * suggests
revdep/library/diyar/new/pillar/DESCRIPTION
cran
- cli * imports
- crayon >= 1.3.4 imports
- ellipsis * imports
- fansi * imports
- lifecycle * imports
- rlang >=0.3.0 imports
- utf8 >= 1.1.0 imports
- utils * imports
- vctrs >= 0.2.0 imports
- DiagrammeR * suggests
- bit64 * suggests
- debugme * suggests
- dplyr * suggests
- ggplot2 * suggests
- knitr * suggests
- lubridate * suggests
- nycflights13 * suggests
- palmerpenguins * suggests
- rmarkdown * suggests
- scales * suggests
- stringi * suggests
- survival * suggests
- testthat >= 3.0.2 suggests
- tibble * suggests
- withr * suggests
revdep/library/diyar/new/rlang/DESCRIPTION
cran
- R >= 3.3.0 depends
- winch * enhances
- utils * imports
- cli * suggests
- covr * suggests
- crayon * suggests
- glue * suggests
- magrittr * suggests
- methods * suggests
- pak * suggests
- pillar * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
- vctrs >= 0.2.3 suggests
- withr * suggests
revdep/library/diyar/new/scales/DESCRIPTION
cran
- R >= 3.2 depends
- R6 * imports
- RColorBrewer * imports
- farver >= 2.0.3 imports
- labeling * imports
- lifecycle * imports
- munsell >= 0.5 imports
- viridisLite * imports
- bit64 * suggests
- covr * suggests
- dichromat * suggests
- ggplot2 * suggests
- hms >= 0.5.0 suggests
- testthat >=2.1.0 suggests
revdep/library/diyar/new/tibble/DESCRIPTION
cran
- R >= 3.1.0 depends
- ellipsis >= 0.2.0 imports
- fansi >= 0.4.0 imports
- lifecycle >= 0.2.0 imports
- magrittr * imports
- methods * imports
- pillar >= 1.6.0 imports
- pkgconfig * imports
- rlang >=0.4.3 imports
- utils * imports
- vctrs >= 0.3.2 imports
- DiagrammeR * suggests
- bench * suggests
- bit64 * suggests
- blob * suggests
- cli * suggests
- covr * suggests
- crayon >= 1.3.4 suggests
- dplyr * suggests
- evaluate * suggests
- formattable * suggests
- ggplot2 * suggests
- hms * suggests
- htmltools * suggests
- knitr * suggests
- lubridate * suggests
- mockr * suggests
- nycflights13 * suggests
- purrr * suggests
- rmarkdown * suggests
- testthat >=3.0.2 suggests
- tidyr * suggests
- withr * suggests
revdep/library/diyar/new/utf8/DESCRIPTION
cran
- R >= 2.10 depends
- covr * suggests
- knitr * suggests
- rlang * suggests
- rmarkdown * suggests
- testthat >= 3.0.0 suggests
revdep/library/diyar/new/vctrs/DESCRIPTION
cran
- R >= 3.3 depends
- ellipsis >= 0.2.0 imports
- glue * imports
- rlang >= 0.4.10 imports
- bit64 * suggests
- covr * suggests
- crayon * suggests
- dplyr >= 0.8.5 suggests
- generics * suggests
- knitr * suggests
- pillar >= 1.4.4 suggests
- pkgdown * suggests
- rmarkdown * suggests
- testthat >= 2.3.0 suggests
- tibble * suggests
- waldo >= 0.2.0 suggests
- withr * suggests
- xml2 * suggests
- zeallot * suggests
revdep/library/diyar/new/viridisLite/DESCRIPTION
cran
- R >= 2.10 depends
- covr * suggests
- ggplot2 >= 1.0.1 suggests
- hexbin >= 1.27.0 suggests
- testthat * suggests
revdep/library/diyar/new/withr/DESCRIPTION
cran
- R >= 3.2.0 depends
- grDevices * imports
- graphics * imports
- stats * imports
- DBI * suggests
- RSQLite * suggests
- covr * suggests
- knitr * suggests
- lattice * suggests
- methods * suggests
- rmarkdown * suggests
- testthat >= 2.1.0 suggests
revdep/library/diyar/old/diyar/DESCRIPTION
cran
- Rfast * imports
- grDevices * imports
- graphics * imports
- methods * imports
- utils * imports
- covr * suggests
- knitr * suggests
- rmarkdown * suggests
- testthat * suggests