Title: | Community Data Explorer for Cincinnati |
---|---|
Description: | This repository serves as the definition of the CoDEC data specifications and provides helpers to create, validate, release, and read CoDEC data. |
Authors: | Cole Brokamp [aut, cre], Erika Manning [aut], Andrew Vancil [aut] |
Maintainer: | Cole Brokamp <[email protected]> |
License: | GPL (>= 3) |
Version: | 2.2.0 |
Built: | 2024-11-06 04:24:53 UTC |
Source: | https://github.com/geomarker-io/codec |
Convert a tibble to a data package (dpkg
) object in R while checking it
against CoDEC data specifications:
as_codec_dpkg( x, name, version, title = character(), description = character(), homepage = character() )
as_codec_dpkg( x, name, version, title = character(), description = character(), homepage = character() )
x |
data.frame or tibble meeting CoDEC data specifications above |
name |
see |
version |
see |
title |
see |
description |
see |
homepage |
see |
The data must include a census tract
identifier column (i.e., census_tract_id_2000
, census_tract_id_2010
, or census_tract_id_2020
).
The column must contain 11-digit
GEOID
identifiers for every census tract in Hamilton County, OH.
The data includes a year column (year
), an integer year representing the
vintage of the data (e.g. 2021
).
The data can optionally include a month column (month
), an integer month of the year.
Data must be structured in a tidy format such that each row is an observation for a specific census tract at a specific year (and month).
a dpkg object
CoDEC colors
codec_colors(n = NULL)
codec_colors(n = NULL)
n |
a numeric vector of color numbers or character vector of color names; if NULL returns named vector of available colors |
plot(1:8, rep(1, 8), col = codec_colors(1:8), pch = 19, cex = 10, axes = FALSE, xlab = "", ylab = "") text(1:8, rep(1.1, 8), labels = names(codec_colors()))
plot(1:8, rep(1, 8), col = codec_colors(1:8), pch = 19, cex = 10, axes = FALSE, xlab = "", ylab = "") text(1:8, rep(1.1, 8), labels = names(codec_colors()))
The required census tract identifier column name is used to merge in tract geographies from the cincy package.
codec_dpkg_as_sf(x)
codec_dpkg_as_sf(x)
x |
a CoDEC dpkg |
an sf
object that is a codec dpkg with an added geometry
column
get_codec_dpkg("drivetime-v0.2.2") |> codec_dpkg_as_sf()
get_codec_dpkg("drivetime-v0.2.2") |> codec_dpkg_as_sf()
The AWS CLI tool must be installed and authenticated to
write to s3://geomarker-io/codec_data
.
The resulting data package will be available publicly.
codec_dpkg_s3_put(x)
codec_dpkg_s3_put(x)
x |
a data package ( |
character string URI of uploaded resource
## Not run: # use aws command line to login interactively via profile sso account" system2("aws", c("sso", "login", "--profile", "geomarker-io")) # make sure to set AWS_PROFILE so the AWS CLI tool knows to use it by default" Sys.setenv("AWS_PROFILE" = "geomarker-io") ## End(Not run)
## Not run: # use aws command line to login interactively via profile sso account" system2("aws", c("sso", "login", "--profile", "geomarker-io")) # make sure to set AWS_PROFILE so the AWS CLI tool knows to use it by default" Sys.setenv("AWS_PROFILE" = "geomarker-io") ## End(Not run)
Public data packages are downloaded from gh://geomarker-io/codec/
using
dpkg::stow()
to cache a local copy in the user's data directory.
get_codec_dpkg(codec_dpkg, overwrite = FALSE)
get_codec_dpkg(codec_dpkg, overwrite = FALSE)
codec_dpkg |
name of CoDEC dpkg |
overwrite |
logical; re-download the remote file even though a local file with the same name exists? |
a CoDEC data package (see dpkg::as_dpkg()
)
get_codec_dpkg("drivetime-v0.2.2")
get_codec_dpkg("drivetime-v0.2.2")