Skip to content

Commit

Permalink
adding new indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
wcurrangroome committed Aug 24, 2024
1 parent 8567bf6 commit 596995a
Show file tree
Hide file tree
Showing 8 changed files with 496 additions and 479 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Description: There are many packages available that facilitate queries to the Ce
work (much of which must be repeated from analysis to analysis), such as identifying
and selecting relevant variables, determining how to accurately calculate derived
measures (e.g., percentages), and naming variables semantically. urbnindicators
abstracts much of this process away and provides users a quick interface to obtain a
substantial set of commonly-used social sciences measures from the ACS.
abstracts much of this process away and provides users a simple interface to obtain
commonly-used social sciences measures from the ACS.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Expand Down
462 changes: 231 additions & 231 deletions R/compile_acs_data.R

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions R/generate_codebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ generate_codebook = function(.data) {
"__" = "_",
"native_hawaiian_other_pacific_islander" = "nhpi",
"hispanic_latino" = "hispanic",
"american_indian_alaska_native" = "native",
"american_indian_alaska_native" = "aian",
"black_african_american" = "black",
"household_income_by_gross_rent_as_a_percentage_of_household_income_in_the_past_12_months" =
"household_income_by_gross_rent_as_a_percentage_of_household_income")),
Expand All @@ -88,13 +88,8 @@ generate_codebook = function(.data) {
## this should cover all of the variables returned by list_acs_variables() / compile_acs_data()
variable_name_crosswalk = dependencies %>%
dplyr::select(raw_name = name, clean_name = clean_names) %>%
dplyr::bind_rows(variable_crosswalk %>%dplyr::select(raw_name = raw_variable_name, clean_name = clean_variable_name)) %>%
## a handful of count columns end in "percent"; we've renamed them to clarify, and are adjusting the clean names accordingly
## in this crosswalk
dplyr::mutate(
clean_name = dplyr::case_when(
stringr::str_detect(clean_name, "household_income_by_gross_rent.*percent$") ~ paste0(clean_name, "_count_estimate"),
TRUE ~ clean_name))
dplyr::bind_rows(variable_crosswalk %>% dplyr::select(raw_name = raw_variable_name, clean_name = clean_variable_name))


####----Document Across Call (Function)----#####
document_across_call = function(across_call) {
Expand Down
323 changes: 160 additions & 163 deletions R/list_acs_variables.R

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ you have the most recent version installed!

## urbnindicators in action

```{r, include = F, echo = F, warning = F, mesage = F, eval = T}
library(dplyr)
library(stringr)
library(urbnindicators)
library(ggplot2)
```


```{r example}
suppressPackageStartupMessages({
library(dplyr)
library(stringr)
library(urbnindicators)
library(ggplot2)
})
# library(dplyr)
# library(stringr)
# library(urbnindicators)
# library(ggplot2)
acs_df = compile_acs_data(
variables = NULL,
Expand Down
98 changes: 49 additions & 49 deletions renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.3.1",
"Version": "4.4.0",
"Repositories": [
{
"Name": "CRAN",
Expand All @@ -11,31 +11,31 @@
"Packages": {
"DBI": {
"Package": "DBI",
"Version": "1.2.2",
"Version": "1.2.3",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"methods"
],
"Hash": "164809cd72e1d5160b4cb3aa57f510fe"
"Hash": "065ae649b05f1ff66bb0c793107508f5"
},
"KernSmooth": {
"Package": "KernSmooth",
"Version": "2.23-22",
"Version": "2.23-24",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"R",
"stats"
],
"Hash": "2fecebc3047322fa5930f74fae5de70f"
"Hash": "9f33a1ee37bbe8919eb2ec4b9f2473a5"
},
"MASS": {
"Package": "MASS",
"Version": "7.3-60.0.1",
"Version": "7.3-61",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
Expand All @@ -44,7 +44,7 @@
"stats",
"utils"
],
"Hash": "b765b28387acc8ec9e9c1530713cb19c"
"Hash": "0cafd6f0500e5deba33be22c46bf6055"
},
"R6": {
"Package": "R6",
Expand All @@ -58,14 +58,14 @@
},
"Rcpp": {
"Package": "Rcpp",
"Version": "1.0.12",
"Version": "1.0.13",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"methods",
"utils"
],
"Hash": "5ea2700d21e038ace58269ecdbeb9ec0"
"Hash": "f27411eb6d9c3dada5edd444b8416675"
},
"RcppProgress": {
"Package": "RcppProgress",
Expand All @@ -86,13 +86,13 @@
},
"backports": {
"Package": "backports",
"Version": "1.4.1",
"Version": "1.5.0",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "c39fbec8a30d23e721980b8afb31984c"
"Hash": "e1e1b9d75c37401117b636b7ae50827a"
},
"bit": {
"Package": "bit",
Expand Down Expand Up @@ -120,15 +120,15 @@
},
"checkmate": {
"Package": "checkmate",
"Version": "2.3.1",
"Version": "2.3.2",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"backports",
"utils"
],
"Hash": "c01cab1cb0f9125211a6fc99d540e315"
"Hash": "0e14e01ce07e7c88fd25de6d4260d26b"
},
"class": {
"Package": "class",
Expand Down Expand Up @@ -161,14 +161,14 @@
},
"cli": {
"Package": "cli",
"Version": "3.6.2",
"Version": "3.6.3",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "1216ac65ac55ec0058a6f75d7ca0fd52"
"Hash": "b21916dd77a27642b447374a5d30ecf3"
},
"clipr": {
"Package": "clipr",
Expand All @@ -192,15 +192,15 @@
},
"crayon": {
"Package": "crayon",
"Version": "1.5.2",
"Version": "1.5.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"grDevices",
"methods",
"utils"
],
"Hash": "e8a1e41acf02548751f45c718d55aa6a"
"Hash": "859d96e65ef198fd43e82b9628d593ef"
},
"curl": {
"Package": "curl",
Expand All @@ -214,14 +214,14 @@
},
"data.table": {
"Package": "data.table",
"Version": "1.15.2",
"Version": "1.15.4",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"methods"
],
"Hash": "536dfe4ac4093b5d115caed7a1a7223b"
"Hash": "8ee9ac56ef633d0c7cab8b2ca87d683e"
},
"dplyr": {
"Package": "dplyr",
Expand Down Expand Up @@ -370,13 +370,13 @@
},
"openssl": {
"Package": "openssl",
"Version": "2.1.1",
"Version": "2.2.1",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"askpass"
],
"Hash": "2a0dc8c6adfb6f032e4d4af82d258ab5"
"Hash": "c62edf62de70cadf40553e10c739049d"
},
"pillar": {
"Package": "pillar",
Expand Down Expand Up @@ -491,24 +491,24 @@
},
"renv": {
"Package": "renv",
"Version": "1.0.5",
"Version": "1.0.7",
"Source": "Repository",
"Repository": "RSPM",
"Requirements": [
"utils"
],
"Hash": "32c3f93e8360f667ca5863272ec8ba6a"
"Hash": "397b7b2a265bc5a7a06852524dabae20"
},
"rlang": {
"Package": "rlang",
"Version": "1.1.3",
"Version": "1.1.4",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"utils"
],
"Hash": "42548638fae05fd9a9b5f3f437fbbbe2"
"Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
},
"rvest": {
"Package": "rvest",
Expand All @@ -531,15 +531,15 @@
},
"s2": {
"Package": "s2",
"Version": "1.1.6",
"Version": "1.1.7",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"Rcpp",
"wk"
],
"Hash": "32f7b1a15bb01ae809022960abad5363"
"Hash": "3c8013cdd7f1d20de5762e3f97e5e274"
},
"segregation": {
"Package": "segregation",
Expand Down Expand Up @@ -570,9 +570,9 @@
},
"sf": {
"Package": "sf",
"Version": "1.0-15",
"Version": "1.0-16",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"DBI",
"R",
Expand All @@ -589,20 +589,20 @@
"units",
"utils"
],
"Hash": "f432b3379fb1a47046e253468b6b6b6d"
"Hash": "ad57b543f7c3fca05213ba78ff63df9b"
},
"stringi": {
"Package": "stringi",
"Version": "1.8.3",
"Version": "1.8.4",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"stats",
"tools",
"utils"
],
"Hash": "058aebddea264f4c99401515182e656a"
"Hash": "39e1144fd75428983dc3f63aa53dfa91"
},
"stringr": {
"Package": "stringr",
Expand Down Expand Up @@ -649,9 +649,9 @@
},
"tidycensus": {
"Package": "tidycensus",
"Version": "1.6.3",
"Version": "1.6.5",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R",
"crayon",
Expand All @@ -672,7 +672,7 @@
"utils",
"xml2"
],
"Hash": "c77c57b67d43addfe568dba21ef4b811"
"Hash": "17c78ef5ebb80ee786680f23dccb68cc"
},
"tidyr": {
"Package": "tidyr",
Expand Down Expand Up @@ -766,13 +766,13 @@
},
"uuid": {
"Package": "uuid",
"Version": "1.2-0",
"Version": "1.2-1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "303c19bfd970bece872f93a824e323d9"
"Hash": "34e965e62a41fcafb1ca60e9b142085b"
},
"vctrs": {
"Package": "vctrs",
Expand Down Expand Up @@ -816,25 +816,25 @@
},
"withr": {
"Package": "withr",
"Version": "3.0.0",
"Version": "3.0.1",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"R",
"grDevices",
"graphics"
],
"Hash": "d31b6c62c10dcf11ec530ca6b0dd5d35"
"Hash": "07909200e8bbe90426fbfeb73e1e27aa"
},
"wk": {
"Package": "wk",
"Version": "0.9.1",
"Version": "0.9.2",
"Source": "Repository",
"Repository": "RSPM",
"Repository": "CRAN",
"Requirements": [
"R"
],
"Hash": "5d4545e140e36476f35f20d0ca87963e"
"Hash": "877644b9b942d429f3708e12c98d1a22"
},
"xml2": {
"Package": "xml2",
Expand Down
Loading

0 comments on commit 596995a

Please sign in to comment.