From 4d41033c0b03154fa19bff1536a5d0c03e45776a Mon Sep 17 00:00:00 2001 From: Eve Perry Date: Tue, 6 Jul 2021 14:25:53 -0700 Subject: [PATCH] remove non-state & empty CoCs (#13) * remove non-state & empty CoCs * bump version number --- DESCRIPTION | 2 +- code/coc_economic_indicators.R | 1 + code/pit_data_processing.R | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 25e9342..703718b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: coc.data.package Title: Point-in-time homelessness counts and covariates by CoC -Version: 0.4.1 +Version: 0.4.2 URL: https://github.com/ucsf-bhhi/coc-data Authors@R: c( person( diff --git a/code/coc_economic_indicators.R b/code/coc_economic_indicators.R index e637eb9..35c736e 100644 --- a/code/coc_economic_indicators.R +++ b/code/coc_economic_indicators.R @@ -180,6 +180,7 @@ fetch_public_program_use <- function(year) { #' Medicaid build_coc_public_program_use <- function(acs_data, tract_crosswalk) { tract_crosswalk %>% + filter(!is.na(coc_number)) %>% left_join(acs_data, by = c("tract_fips" = "fips", "year")) %>% group_by(coc_number, year) %>% summarise( diff --git a/code/pit_data_processing.R b/code/pit_data_processing.R index 95982e0..45163b0 100644 --- a/code/pit_data_processing.R +++ b/code/pit_data_processing.R @@ -72,7 +72,11 @@ get_long_pit_data <- function(wide_pit_data) { get_coc_categories <- function(wide_pit_data) { wide_pit_data %>% # category is only present in the last year of data so filter for that one - filter(!is.na(coc_category)) %>% + filter( + !is.na(coc_category), + !(str_sub(coc_number, 1, 2) %in% c("GU", "MP", "VI", "PR")), + coc_number != "MO-604a" + ) %>% # just keep these variables around select(coc_number, coc_name, coc_category) }