Code Monkey home page Code Monkey logo

ccao's Introduction

CCAO

R-CMD-check test-coverage lint pre-commit codecov

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.

For detailed documentation on included functions and data, visit the full reference list.

Installation

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

# 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:

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)
pin year char_yrblt char_gar1_size char_ext_wall township_code
10254170360000 2015 1948 7 2 72
09363230550000 2019 1923 7 3 73
10253190450000 2018 1951 3 2 71
13253230040000 2019 1969 7 2 72
# 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)
PIN Year Year Built Garage 1 Size Exterior Wall Material Township Code Township Name Triad Name Next Reass. Year
10-25-417-036 2015 1948 0 cars Masonry 72 Lake City 2024
09-36-323-055 2019 1923 0 cars Frame + Masonry 73 Lake View City 2024
10-25-319-045 2018 1951 2 cars Masonry 71 Jefferson City 2024
13-25-323-004 2019 1969 0 cars Masonry 72 Lake City 2024

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.

ccao's People

Contributors

damonamajor avatar dfsnow avatar jeancochrane avatar wagnerlmichael avatar wrridgeway avatar

ccao's Issues

Release v1.3.0

Cut a new release of the package containing the following changes:

  • Add pre-commit badge (4b9688c)
  • Deploy to GitHub pages (c559f46)
  • Add core team to CODEOWNERS (#1)
  • Add meta_card_protation_rate and loc_tax_municipality_name to vars_dict (#4)
  • Update authors and add docs to sidebar (#5)
  • Consolidate vars_dict to focus exclusively on renaming/recoding (#6)

Release checklist

  • Make sure the changes meet styling and linting requirements:
    • Styling: Run styler::style_pkg() in the console
    • Linting: Run lintr::lint_package() in the console
  • Build any documentation updates by running devtools::document() in the console
  • Run the build and test processes locally to check for errors:
    • Build: In RStudio, go to the Build tab, then hit Check
    • Test: In RStudio, go to the Build tab, then hit Test OR devtools::test() in the console
  • Check the vignettes by building them locally. Run pkgdown::build_site() in the console
  • Rebuild the README manually. Knit README.Rmd from within RStudio
  • Increment the package version in the DESCRIPTION file appropriately, following the schema laid out in the README
  • If the code updates were so substantial that the current database also needs to be updated, follow the database release checklist issue template
  • Push the code updates to GitHub. Wait for the resulting CI pipeline to finish
  • If there are no pipeline errors, merge the branch to master
  • Wait for the merge CI pipeline to finish. If there are no errors, cut a new release from master. Create a new git tag with the version number and title the release with the same version number. Be sure to add a changelog detailing what you updated

Update vars_dict.rda

Forgot to update this when I updated vars_dict.csv ๐Ÿคฆโ€โ™‚๏ธ

Fix `is_corner_lot` athena name

I incorrectly assumed the ccao db was in our dag and that is_corner_lot would exist as a column name because of that. Since the ccao db is not in the dag, this column only appears as ccao_is_corner_lot and needs to updated in vars_dict.

Move `vars_dict` out of this package to a shared location

The vars_dict dataset in this package is used heavily by ccao-data/model-res-avm and ccao-data/model-condo-avm. However, iterating with the model requires us to constantly update this dictionary (and thus the package). Additionally, keeping the dictionary up-to-date is tedious, manual process.

I propose we automate the creation and maintenance of this dictionary and move it out of this package on to S3. We can use Glue and other AWS APIs to construct it on a schedule, then store it in a public bucket.

Add several new columns to vars dict

We need to add:

  • meta_sale_count_past_n_years
  • char_class
  • prox_airport_dnl_total
  • prox_nearest_secondary_road_dist_ft
  • prox_nearest_university_dist_ft
  • prox_nearest_vacant_land_dist_ft
  • ccao_is_active_exe_homeowner
  • ccao_is_corner_lot
  • ccao_n_years_exe_homeowner

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.