Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/elipousson/baltimoredata

📄 R package with assorted data on Baltimore city, MD
https://github.com/elipousson/baltimoredata

baltimore r r-package

Last synced: 27 days ago
JSON representation

📄 R package with assorted data on Baltimore city, MD

Awesome Lists containing this project

README

        

---
output: github_document
---

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

# baltimoredata

The goal of baltimoredata is to make data related to Baltimore City, Maryland more accessible and consistent for R users. The package is designed to work well with the [mapbaltimore](https://elipousson.github.io/mapbaltimore/) and [bcpss](https://elipousson.github.io/bcpss/) packages that I am also developing.

Currently, this package only includes two data sets: the Baltimore Neighborhood Indicators Alliance (BNIA) Vital Signs data between 2010 and 2018 and the definitions for the variables included in the Vital Signs data.

## Installation

You can install baltimoredata with the remotes package:

``` r
remotes::install_github("elipousson/baltimoredata")
```

## Example

```{r example}
library(baltimoredata)
library(dplyr)
library(ggplot2)
```

The BNIA Vital Signs data is useful for making comparisons between different areas of the city, between multiple years, and multiple related variables. For example, see the beeswarm plot below comparing the BNIA affordability indices for rent and mortgage:

```{r vital_signs}
vital_signs_2010_2018 %>%
filter(indicator %in% c("affordability_index_mortgage", "affordability_index_rent"),
year == 2015) %>%
ggplot(aes(x = label, y = value, color = value)) +
ggbeeswarm::geom_quasirandom(alpha = 0.5, size = 3) +
coord_flip() +
theme_minimal() +
scale_color_viridis_c(guide = FALSE) +
labs(title = "Rent and mortgage affordability indices, 2015",
x = "",
y = "Value",
caption = "Data courtesy Baltimore Neighborhood Indicators Alliance Vital Signs, 2015")

```

Note that all BNIA Vital Signs Indicators are available for all years. The `vital_signs_indicators` provides labels, definitions, and the years available for all BNIA Vital Signs.

```{r indicators}
glimpse(vital_signs_indicators)
```