Skip to content

Commit

Permalink
Merge pull request nhs-r-community#190 from nhs-r-community/secondary…
Browse files Browse the repository at this point in the history
…-axis

tj fixes to secondary axis PR
  • Loading branch information
tomjemmett authored Oct 20, 2023
2 parents 8aac323 + 364b11c commit f4728d4
Show file tree
Hide file tree
Showing 6 changed files with 457 additions and 482 deletions.
4 changes: 2 additions & 2 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
linters: linters_with_defaults(
line_length_linter(92),
cyclocomp_linter(20),
line_length_linter(120),
cyclocomp_linter(23),
indentation_linter(hanging_indent_style = "tidy"),
object_name_linter("snake_case"))
exclusions: list(
Expand Down
8 changes: 0 additions & 8 deletions R/ptd_validate_spc_options.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ ptd_validate_spc_options <- function(options, .data) {
check("facet_field")
check("trajectory")

pulled_counts <- .data |>
dplyr::group_by(
pick(c(options[["date_field"]], options[["facet_field"]]))
) |>
dplyr::count() |>
dplyr::pull("n")

assertthat::assert_that(

all(
dplyr::count(
dplyr::group_by_at(
Expand Down
12 changes: 6 additions & 6 deletions tests/testthat/_snaps/ptd_spc.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
--------------------------------
# A tibble: 1 x 8
mean_col lpl upl n common_cause special_cause_improvement
<dbl> <dbl> <dbl> <int> <dbl> <int>
<dbl> <dbl> <dbl> <int> <int> <int>
1 0.142 -3.01 3.29 20 20 0
# i 2 more variables: special_cause_concern <int>, variation_type <chr>

Expand All @@ -34,7 +34,7 @@
--------------------------------
# A tibble: 1 x 9
rebase_group mean_col lpl upl n common_cause special_cause_improvement
<dbl> <dbl> <dbl> <dbl> <int> <dbl> <int>
<dbl> <dbl> <dbl> <dbl> <int> <int> <int>
1 0 0.142 -3.01 3.29 20 20 0
# i 2 more variables: special_cause_concern <int>, variation_type <chr>

Expand All @@ -54,7 +54,7 @@
--------------------------------
# A tibble: 2 x 9
f mean_col lpl upl n common_cause special_cause_improvement
<dbl> <dbl> <dbl> <dbl> <int> <dbl> <int>
<dbl> <dbl> <dbl> <dbl> <int> <int> <int>
1 0 0.0746 -2.60 2.75 10 10 0
2 1 0.209 -3.28 3.70 10 10 0
# i 2 more variables: special_cause_concern <int>, variation_type <chr>
Expand All @@ -75,7 +75,7 @@
--------------------------------
# A tibble: 2 x 10
f rebase_group mean_col lpl upl n common_cause
<dbl> <dbl> <dbl> <dbl> <dbl> <int> <dbl>
<dbl> <dbl> <dbl> <dbl> <dbl> <int> <int>
1 0 0 0.0746 -2.60 2.75 10 10
2 1 0 0.209 -3.28 3.70 10 10
# i 3 more variables: special_cause_improvement <int>,
Expand All @@ -97,7 +97,7 @@
--------------------------------
# A tibble: 1 x 9
mean_col lpl upl n common_cause special_cause_improvement
<dbl> <dbl> <dbl> <int> <dbl> <int>
<dbl> <dbl> <dbl> <int> <int> <int>
1 0.142 -3.01 3.29 20 20 0
# i 3 more variables: special_cause_concern <int>, variation_type <chr>,
# assurance_type <chr>
Expand All @@ -118,7 +118,7 @@
--------------------------------
# A tibble: 1 x 9
mean_col lpl upl n common_cause special_cause_improvement
<dbl> <dbl> <dbl> <int> <dbl> <int>
<dbl> <dbl> <dbl> <int> <int> <int>
1 0.142 -3.01 3.29 20 20 0
# i 3 more variables: special_cause_concern <int>, variation_type <chr>,
# assurance_type <chr>
Expand Down
Loading

0 comments on commit f4728d4

Please sign in to comment.