Skip to content

Commit

Permalink
bug fix (#27)
Browse files Browse the repository at this point in the history
deprecated functions removed (#28)
  • Loading branch information
andrewallenbruce committed Oct 31, 2023
1 parent 34c801d commit a841028
Show file tree
Hide file tree
Showing 17 changed files with 134 additions and 2,323 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ export(affiliations)
export(bene_years)
export(beneficiaries)
export(betos)
export(by_geography)
export(by_provider)
export(by_service)
export(cc_years)
export(change)
export(chg)
Expand Down
10 changes: 3 additions & 7 deletions R/compare.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ NULL

#' @param df < *tbl_df* > // **required**
#'
#' @param ... For future use.
#'
#'
#' [tibble()] returned from `utilization(type = "service")`
#'
#' @examplesIf interactive()
Expand All @@ -35,7 +32,7 @@ NULL
#'
#' @autoglobal
#' @export
compare_hcpcs <- function(df, ...) {
compare_hcpcs <- function(df) {

if (!inherits(df, "utilization_service")) {
cli::cli_abort(c(
Expand Down Expand Up @@ -117,8 +114,7 @@ compare_conditions <- function(df, pivot = FALSE) {
tidyr::pivot_longer(cols = !c(year, level, sublevel),
names_to = "condition",
values_to = "prevalence") |>
dplyr::filter(!is.na(prevalence),
year %in% cc_years())
dplyr::filter(!is.na(prevalence), year %in% cc_years())

y <- dplyr::select(x, year, condition, sublevel) |>
dplyr::mutate(set = "specific",
Expand All @@ -138,7 +134,7 @@ compare_conditions <- function(df, pivot = FALSE) {

x$sublevel <- NULL

vctrs::vec_rbind(x, state, national) |>
results <- vctrs::vec_rbind(x, state, national) |>
dplyr::mutate(level = forcats::fct_inorder(level)) |>
dplyr::arrange(year, condition)

Expand Down
5 changes: 3 additions & 2 deletions R/conditions.R
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,9 @@ conditions <- function(year,
return(invisible(NULL))
}

results <- httr2::resp_body_json(response, simplifyVector = TRUE) |>
df2chr()
results <- httr2::resp_body_json(response, simplifyVector = TRUE)

if (!tidy) results <- df2chr(results)

if (tidy) {
results$year <- year
Expand Down
Loading

0 comments on commit a841028

Please sign in to comment.