openpharma/visR

Remove 'PARAM' and 'PARAMCD' warning from `visr()`

ddsjoberg opened this issue · 0 comments

The visualizations for time to event data in visR are amazing and will be used by many people, including those whose data does not follow CDISC conventions. We can do a couple of things to improve their experience, while not taking away from the experience of those working with CDISC data.

When data is used that does not have 'PARAM' and 'PARAMCD' columns, visr() prints a warning (see below) about the x-axis label. We don't need a warning to tell users what was not done. This should be handled similarly to other places in the package regarding labels. For example, if a column has a label, we use it. But if the column doesn't have a label, we use the variable name in visr(): we don't print a warning that the variable label wasn't used. It's already well documented in the the visr() help file, that if the 'PARAM' and 'PARAMCD' are present, their values will be used to construct the x-axis label. Let's remove this warning

estimate_KM(data, strata = "sex") %>%
  visr()
#> Warning in visr.survfit(.): The x-axis label was not specified and could also
#> not be automatically determined due to absence of 'PARAM' and 'PARAMCD'.