Skip to content

Commit

Permalink
* added zip code database
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Dec 11, 2024
1 parent 7a048b9 commit da531f2
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/pins.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mount_board <- function(source = c("local", "remote"), package = "fuimus") {
switch(
source,
local = pins::board_folder(
# system.file("data", "zcta_crosswalk.rda", package = package)
fs::path_package("extdata/pins", package = package)),
remote = pins::board_url(
gh_raw(
Expand Down
23 changes: 23 additions & 0 deletions data-raw/pins_internal.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
pin_update <- function(x, name, title, description) {

board <- pins::board_folder(
here::here("inst/extdata/pins"))

board |>
pins::pin_write(
x,
name = name,
title = title,
description = description,
type = "qs")

board |> pins::write_board_manifest()
}

delete_pins <- function(pin_names) {

board <- pins::board_folder(
here::here("inst/extdata/pins"))

pins::pin_delete(board, names = pin_names)
}
10 changes: 10 additions & 0 deletions data-raw/zipcodedb.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
source(here::here("data-raw", "pins_internal.R"))

zipcodes <- zipcodeR::zip_code_db

pin_update(
zipcodes,
name = "zipcodes",
title = "Zip Code Database from zipcodeR package",
description = "https://github.com/MacHu-GWU/uszipcode-project/files/5183256/simple_db.log"
)
2 changes: 2 additions & 0 deletions inst/extdata/pins/_pins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zipcodes:
- zipcodes/20241211T045538Z-45cd1/
10 changes: 10 additions & 0 deletions inst/extdata/pins/zipcodes/20241211T045538Z-45cd1/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file: zipcodes.qs
file_size: 3177603
pin_hash: 45cd18a22eb1a98a
type: qs
title: Zip Code Database from zipcodeR package
description: https://github.com/MacHu-GWU/uszipcode-project/files/5183256/simple_db.log
tags: ~
urls: ~
created: 20241211T045538Z
api_version: 1
Binary file not shown.

0 comments on commit da531f2

Please sign in to comment.