diff --git a/R/Figures.R b/R/Figures.R index efb56c8e..b20d6c89 100644 --- a/R/Figures.R +++ b/R/Figures.R @@ -919,7 +919,10 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD showgrid = FALSE, tickcolor = "black" ), yaxis = list( - title = paste0(param1$TADA.CharacteristicName[1], " ", param1$TADA.ResultMeasure.MeasureUnitCode[1]), + title = stringr::str_remove_all(stringr::str_remove_all( + stringr::str_remove_all(paste0(param1$TADA.CharacteristicName[1], " ", param1$TADA.ResultMeasure.MeasureUnitCode[1]), stringr::fixed(" (NA)")), + stringr::fixed("NA ") + ), stringr::fixed(" NA")), titlefont = list(size = 16, family = "Arial"), tickfont = list(size = 16, family = "Arial"), hoverformat = ",.4r", linecolor = "black", rangemode = "tozero", @@ -928,7 +931,10 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD yaxis2 = list( side = "right", overlaying = "y", - title = paste0(param2$TADA.CharacteristicName[1], " ", param2$TADA.ResultMeasure.MeasureUnitCode[1]), + title = stringr::str_remove_all(stringr::str_remove_all( + stringr::str_remove_all(paste0(param2$TADA.CharacteristicName[1], " ", param2$TADA.ResultMeasure.MeasureUnitCode[1]), stringr::fixed(" (NA)")), + stringr::fixed("NA ") + ), stringr::fixed(" NA")), titlefont = list(size = 16, family = "Arial"), tickfont = list(size = 16, family = "Arial"), hoverformat = ",.4r", linecolor = "black", rangemode = "tozero", @@ -951,11 +957,14 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD data = param1, x = ~ as.Date(ActivityStartDate), y = ~TADA.ResultMeasureValue, - name = paste0( + name = stringr::str_remove_all(stringr::str_remove_all( + stringr::str_remove_all(paste0( param1$TADA.ResultSampleFractionText, " ", param1$TADA.CharacteristicName, " ", param1$TADA.MethodSpeciationName - ), + ), stringr::fixed(" (NA)")), + stringr::fixed("NA ") + ), stringr::fixed(" NA")), marker = list( size = 10, color = tada.pal[5], @@ -992,11 +1001,14 @@ TADA_TwoCharacteristicScatterplot <- function(.data, id_cols = "TADA.ComparableD data = param2, x = ~ as.Date(ActivityStartDate), y = ~TADA.ResultMeasureValue, - name = paste0( - param2$TADA.ResultSampleFractionText, " ", - param2$TADA.CharacteristicName, " ", - param2$TADA.MethodSpeciationName - ), + name = stringr::str_remove_all(stringr::str_remove_all( + stringr::str_remove_all(paste0( + param2$TADA.ResultSampleFractionText, " ", + param2$TADA.CharacteristicName, " ", + param2$TADA.MethodSpeciationName + ), stringr::fixed(" (NA)")), + stringr::fixed("NA ") + ), stringr::fixed(" NA")), marker = list( size = 10, color = tada.pal[3], line = list(color = tada.pal[12], width = 2)