Skip to content

Commit

Permalink
Add data-raw files
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewallenbruce committed Nov 22, 2024
1 parent e2408aa commit a96415d
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 7 deletions.
10 changes: 10 additions & 0 deletions R/gert_git.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
files_to_stage <- gert::git_status() |>
dplyr::filter(!staged) |>
dplyr::pull(file)

files_to_stage |>
gert::git_add()

gert::git_commit_all("Add data-raw files")

gert::git_push()
30 changes: 25 additions & 5 deletions data-raw/nucc_pins.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
source(here::here("data-raw", "pins_internal.R"))

# -- Data wrangling code here -- #
cleaned_csvs <- fs::dir_info(glue::glue("{here::here()}/data-raw/clean/csvs"))$path

tx_100 <- readr::read_csv(
file = tools::file_path_sans_ext(cleaned_csvs[1]),
id = "filename",
show_col_types = FALSE,
col_types = "c",
name_repair = janitor::make_clean_names
) |>
dplyr::reframe(
release = basename(filename),
version,
release_date,
code,
grouping = type,
classification,
specialization,
definition,
notes
)

pin_update(
dataset,
name = "object_name",
title = "Short Description",
description = "Long Description"
tx_100,
name = "tax_v_10.0",
title = "Taxonomy Codeset v10.0",
description = "Health Care Provider Taxonomy Code Set, Version 10.1, Released 2010-01-01",
force = TRUE
)
5 changes: 3 additions & 2 deletions data-raw/pins_internal.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pin_update <- function(x, name, title, description) {
pin_update <- function(x, name, title, description, force = FALSE) {

board <- pins::board_folder(
here::here("inst/extdata/pins"))
Expand All @@ -9,7 +9,8 @@ pin_update <- function(x, name, title, description) {
name = name,
title = title,
description = description,
type = "qs")
type = "qs",
force_identical_write = force)

board |> pins::write_board_manifest()
}
Expand Down
4 changes: 4 additions & 0 deletions inst/extdata/pins/_pins.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tax_v_10.0:
- tax_v_10.0/20241122T094232Z-7a358/
tax_v_10.1:
- tax_v_10.1/20241122T093658Z-1ced0/
10 changes: 10 additions & 0 deletions inst/extdata/pins/tax_v_10.0/20241122T094232Z-7a358/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file: tax_v_10.qs
file_size: 82399
pin_hash: 7a35826978edb537
type: qs
title: Taxonomy Codeset v10.0
description: Health Care Provider Taxonomy Code Set, Version 10.1, Released 2010-01-01
tags: ~
urls: ~
created: 20241122T094232Z
api_version: 1
Binary file not shown.
10 changes: 10 additions & 0 deletions inst/extdata/pins/tax_v_10.1/20241122T093658Z-1ced0/data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file: tax_v_10.qs
file_size: 82357
pin_hash: 1ced06e3c30f40b2
type: qs
title: Taxonomy Codeset v10.1
description: Health Care Provider Taxonomy Code Set, Version 10.1, Released 2010-07-01
tags: ~
urls: ~
created: 20241122T093658Z
api_version: 1
Binary file not shown.

0 comments on commit a96415d

Please sign in to comment.