insightsengineering / chevron

Standard TLGs For Clinical Trials Reporting
https://insightsengineering.github.io/chevron/
Other
11 stars 1 forks source link

allow numeric x axis in mng01 plots #745

Closed clarkliming closed 4 months ago

clarkliming commented 5 months ago

https://github.com/insightsengineering/chevron/blob/ea38d6c137045683179e81ea2d9ca5aac74cd4d2/R/mng01.R#L80

it seems that we allow numeric input in the validation, but it is then converted to character.

in addition, in preprocessing we already have the dunlin::ls_unite call. this couls be improved

w316liu commented 5 months ago

One more improvement for numeric x-aix: allow ticks and ticks labels.

barnett11 commented 5 months ago

I thought we had continuous x-axis from this request below? https://github.com/insightsengineering/chevron/issues/360

w316liu commented 5 months ago

@barnett11 you're right, after updating citril/chevron to the latest version, I can get the numeric x-axis. However, the ticks and tick labels still cannot be cusomized

clarkliming commented 5 months ago

ah ok, my bad; this is the variable name conversion, not the x value conversion

BFalquet commented 5 months ago

I think we need an update in tern::g_lineplot to be able to pass the tick labels while keeping the table. What do you think @edelarua ?

edelarua commented 5 months ago

Currently the user can add these customizations in themselves using scale_x_continuous(), but we should be able to add this in to g_lineplot as well, similarly to the xticks argument to g_km.

edelarua commented 5 months ago

I have opened a PR for this in tern: https://github.com/insightsengineering/tern/pull/1244

BFalquet commented 4 months ago

I am closing this issue because changes in tern now allow this customization in chevron without further changes needed, e.g.

run(mng01, syn_data, dataset = "adlb", x_var = c("AVISITN"), xticks = c("a" = -3, "b" = 0, "c" = 3), xlim = c(-2, 8))

observedresults

image