Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ccao-data/ccao

R package of functions and datasets used throughout the CCAO assessment pipeline
https://github.com/ccao-data/ccao

assessment property-taxes r r-package taxes

Last synced: about 11 hours ago
JSON representation

R package of functions and datasets used throughout the CCAO assessment pipeline

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%"
)
```

# CCAO

[![R-CMD-check](https://github.com/ccao-data/ccao/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ccao-data/ccao/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/ccao-data/ccao/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/ccao-data/ccao/actions/workflows/test-coverage.yaml)
[![lint](https://github.com/ccao-data/ccao/actions/workflows/lint.yaml/badge.svg)](https://github.com/ccao-data/ccao/actions/workflows/lint.yaml)
[![pre-commit](https://github.com/ccao-data/ccao/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/ccao-data/ccao/actions/workflows/pre-commit.yaml)
[![codecov](https://codecov.io/gh/ccao-data/ccao/branch/master/graph/badge.svg)](https://codecov.io/gh/ccao-data/ccao)

A package to manage, distribute, and version control *CCAO-specific* functions. These functions are used throughout CCAO applications, models, and diagnostics. For generalized versions of assessment-related functions, see [assessR](https://github.com/ccao-data/assessr).

For detailed documentation on included functions and data, [**visit the full reference list**](https://ccao-data.github.io/ccao/reference/index.html).

## Installation

You can install the released version of `ccao` directly from GitHub with one of the following commands:

```{r, eval=FALSE}
# Using remotes
remotes::install_github("ccao-data/ccao")

# Using renv
renv::install("ccao-data/ccao")

# Using pak
pak::pak("ccao-data/ccao")

# Append the @ symbol for a specific version
remotes::install_github("ccao-data/[email protected]")
```

## Basic usage

Here is a quick example using `ccao` functions with included sample data:

```{r, message=FALSE, results='asis'}
library(ccao)
library(dplyr)
library(knitr)

# Create a small subsample of data. This is the "raw" data taken from SQL
sample_data <- chars_sample_athena %>%
select(pin, year, char_yrblt, char_gar1_size, char_ext_wall) %>%
slice(c(1, 2, 5, 14)) %>%
mutate(township_code = c("72", "73", "71", "72"))

sample_data %>%
kable(digits = 3)

# Recode/rename/clean data using town_ and vars_ functions from ccao
sample_data %>%
mutate(
pin = pin_format_pretty(pin),
township_name = town_convert(township_code),
triad_name = town_get_triad(township_code, name = TRUE),
`Next Reass. Year` = town_get_assmnt_year(
township_code,
round_type = "ceiling"
)
) %>%
vars_recode(type = "long") %>%
vars_rename(names_from = "athena", names_to = "pretty") %>%
kable(digits = 3)
```

## CCAO colors

The CCAO Communications Department created a palette of colors for CCAO press materials and visualizations. Navy, gold, and buttermilk are the colors used in the CCAO logo. Typically navy and gold are used for discrete values in plots. The hex codes for these colors are available via the named list `ccao_colors`.

```{r colors, echo=FALSE, fig.height=1, warning=FALSE}
library(ggplot2)

ggplot() +
geom_tile(aes(x = 1:12, y = 1), fill = ccao::ccao_colors) +
geom_text(
aes(
x = 1:12,
y = 1,
label = names(ccao::ccao_colors),
color = c(rep("1", 5), "2", rep("1", 5), "2")
),
angle = 90,
vjust = 0.3
) +
scale_color_manual(
guide = "none",
values = c("1" = "black", "2" = "white")
) +
scale_x_discrete(expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
theme_minimal() +
theme(
axis.title = element_blank()
)
```