divseg

Compute Diversity and Segregation Indices

https://github.com/christopherkenny/divseg

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
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Compute Diversity and Segregation Indices

Basic Info
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created about 5 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



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

# divseg 



[![CRAN
status](https://www.r-pkg.org/badges/version/divseg)](https://CRAN.R-project.org/package=divseg)
[![R-CMD-check](https://github.com/christopherkenny/divseg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/christopherkenny/divseg/actions/workflows/R-CMD-check.yaml)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![divseg status
badge](https://christopherkenny.r-universe.dev/badges/divseg)](https://christopherkenny.r-universe.dev/divseg)


`divseg` implements common measures of diversity (within-geography) and segregation (across-geographies).

## Installation

You can install the released version of divseg from [CRAN](https://CRAN.R-project.org) with:

``` r
install.packages("divseg")

```
You can install the released version of divseg from [GitHub](https://github.com/christopherkenny/divseg/) with:

``` r
pak::pak('christopherkenny/divseg')
```

## Example

The basic workflow relies on a `tibble` where each row represents a geography and has columns that represent some form of population data.

```{r lib}
library(divseg)
```

`divseg` comes with two example datasets. `de_county` contains 2010 Census data on the counties in Delaware. `de_tract` likewise has 2010 Census data on the tracts in Delaware.
```{r data}
data('de_county')
data('de_tract')
```

A pretty standard function call returns a vector, where the first entry is a `tibble` and the second is `tidyselect` language.
```{r example}
ds_blau(.data = de_county, .cols = starts_with('pop_'))
```

More importantly, if you specify an argument to `.name`, all functions are pipe-able.
```{r pipe}
de_county |>
  ds_blau(starts_with('pop_'), .name = 'blau') |>
  ds_delta(starts_with('pop_'), .name = 'delta') |>
  dplyr::relocate(blau, delta)
```

Each function has a partner that can go inside calls to `dplyr::mutate()` by dropping the `ds_` prefix:
```{r}
de_county |>
  dplyr::mutate(herf = hhi(starts_with('pop_'))) |>
  dplyr::relocate(herf)
```

Owner

  • Name: Christopher T. Kenny
  • Login: christopherkenny
  • Kind: user
  • Location: Cambridge, MA
  • Company: Harvard University

Redistricting and rstats. Harvard University, PhD Candidate, Department of Government. Cornell '19.

GitHub Events

Total
  • Push event: 4
Last Year
  • Push event: 4

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 38
  • Total Committers: 2
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.158
Past Year
  • Commits: 12
  • Committers: 2
  • Avg Commits per committer: 6.0
  • Development Distribution Score (DDS): 0.5
Top Committers
Name Email Commits
Christopher Kenny c****4@c****u 32
Lionel Henry l****y@g****m 6
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • 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
Pull Request Authors
  • lionel- (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 281 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: divseg

Calculate Diversity and Segregation Indices

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 281 Last month
Rankings
Forks count: 17.8%
Dependent packages count: 29.8%
Stargazers count: 31.7%
Average: 32.0%
Dependent repos count: 35.5%
Downloads: 45.2%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • dplyr * imports
  • magrittr * imports
  • rlang >= 0.1.2 imports
  • sf imports
  • tibble * imports
  • tidyselect * imports
  • units * imports
  • roxygen2 * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite