Skip to content

Commit 8c70786

Browse files
author
Fran Barton
committed
Workaround for issue #110
1 parent bf8bf68 commit 8c70786

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

R/spcr_make_report.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ make_spc_data <- function(
207207
measure_data
208208
) {
209209
measure_data |>
210+
# remove duplicate dttms (using `arrange` first in order to keep the higher
211+
# "value" - which should be first anyway... This should only remove
212+
# zeroes from the "value" column, not the time since last event!)
213+
dplyr::arrange(desc(pick("value"))) |>
214+
dplyr::distinct(pick("date"), .keep_all = TRUE) |>
215+
dplyr::arrange(pick("date")) |>
210216
NHSRplotthedots::ptd_spc(
211217
rebase = align_rebase_dates(rebase_dates, measure_data),
212218
value_field = "value",
@@ -259,7 +265,7 @@ make_spc_chart <- function(
259265
y = dplyr::last(spc_data[["y"]]),
260266
shape = "circle filled",
261267
colour = "grey65", # #a6a6a6 (matches plotthedots grey)
262-
fill = "grey90", # #e5e5e5
268+
fill = NA, # so the PTD dot can be seen
263269
size = 5,
264270
stroke = 2
265271
)

0 commit comments

Comments
 (0)