Skip to content

Commit

Permalink
Merge pull request #201 from darwin-eu/snake_case_category
Browse files Browse the repository at this point in the history
categories all as snake case
  • Loading branch information
edward-burn authored Jul 11, 2024
2 parents c5cc70d + db00838 commit a4b213f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion R/getRoutes.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ getRouteCategories <- function(cdm) {
) |>
dplyr::mutate(route_category = dplyr::if_else(
is.na(.data$route_category),
"unclassified route",
"unclassified_route",
.data$route_category
)) |>
dplyr::select("route_category") |>
Expand Down
2 changes: 1 addition & 1 deletion R/stratifyByRoute.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ stratifyByRouteCategory <- function(x, cdm, keepOriginal = FALSE){
) |>
dplyr::mutate(route_category = dplyr::if_else(
is.na(.data$route_category),
"unclassified route",
"unclassified_route",
.data$route_category
)) |>
dplyr::select("concept_id", "route_category") |>
Expand Down
2 changes: 1 addition & 1 deletion R/subsetOnRouteCategory.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ subsetOnRouteCategory <- function(x, cdm, routeCategory){
) |>
dplyr::mutate(route_category = dplyr::if_else(
is.na(.data$route_category),
"unclassified route",
"unclassified_route",
.data$route_category
)) |>
dplyr::filter(.data$route_category %in% .env$routeCategory) |>
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-dbms.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_that("redshift", {

expect_no_error(routeCat <- getRouteCategories(cdm))
expect_true(all(routeCat %in%
c(doseFormToRoute$route_category, "unclassified route")))
c(doseFormToRoute$route_category, "unclassified_route")))
# alphabetical order
expect_identical(routeCat,
sort(getRouteCategories(cdm)))
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-subsetOnRouteCategory.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("subset on route category", {

ing_codes_sub <- subsetOnRouteCategory(ing_codes, cdm, "oral")

ing_codes_sub2 <- subsetOnRouteCategory(ing_codes, cdm, "unclassified route")
ing_codes_sub2 <- subsetOnRouteCategory(ing_codes, cdm, "unclassified_route")
expect_identical(ing_codes, ing_codes_sub2)

# expected errors
Expand Down

0 comments on commit a4b213f

Please sign in to comment.