Closed Melkiades closed 1 year ago
A bit of code to help:
I had to hardcode the function g_lineplot it for one of my TLGs:
# df_N <- as.data.frame(table(alt_counts_df[[strata]], exclude = c(NA, NaN, Inf))) # nolint
df_N <- aggregate(USUBJID ~ eval(parse(text = strata)), data = alt_counts_df, FUN = function(x) length(unique(x))) # nolint
knowing that USUBJID has to be defined in the parameters of the function somehow
A bit of code to help:
I had to hardcode the function g_lineplot it for one of my TLGs:
# df_N <- as.data.frame(table(alt_counts_df[[strata]], exclude = c(NA, NaN, Inf))) # nolint df_N <- aggregate(USUBJID ~ eval(parse(text = strata)), data = alt_counts_df, FUN = function(x) length(unique(x))) # nolint
knowing that USUBJID has to be defined in the parameters of the function somehow
@ayogasekaram could you take a look at this, please? Thank you!!! :)
@ayogasekaram Actually on this plot, there is something else that is wrong:
It does not link all the points (because of the different nominal time that we have between the Treatment groups).
So I could also fix it myself by adding in g_lineplot : df_stats <- df_stats[!is.na(df_stats$mean),] ## could be coded in dplyr as well
before the line of code:
Result:
thank you @legrasv for your code suggestions! I believe your second suggestion is already implemented in g_lineplot here. the default for the mid
variable is "mean" which is identical to the line of code you have above.
Sounds good thank you @ayogasekaram
Discussed in https://github.com/insightsengineering/tlg-catalog/discussions/130