Order dot plot labels and only show first occurrence of label

create_order_label_der(
  indata,
  groupvars,
  groupeff,
  space_btwn_out_yn = "Y",
  dataout = NULL
)

Arguments

indata

(data.frame) data frame for dot plot

groupvars

variables to order by

groupeff

effects table outcome order

space_btwn_out_yn

control spacing between outcomes

dataout

(data.frame) ordered data frame for dot plot

Value

data frame for specified type of analysis

Examples

dot_plot_src <- subset(effects_table, Type == "Binary")
dot_data <- prepare_dot_data_b(dot_plot_src)
#> [2024-07-16 15:50:10] > Prepare Dot plot data for binary outcomes

dot_plot_data <- create_order_label_der(
  indata = dot_data,
  groupvars = c("type", "factor", "outcome"),
  groupeff = c("group"),
  space_btwn_out_yn = "N"
)
#> [2024-07-16 15:50:10] > Dataout object from the create_order_label_der function is created

head(dot_plot_data)
#> # A tibble: 6 × 12
#>    rate treatment type   factor  outcome         group neword allobs mylab  fobs
#>   <dbl> <chr>     <chr>  <chr>   <fct>           <int>  <dbl>  <dbl> <chr> <dbl>
#> 1  0.46 Drug A    Binary Benefit Primary Effica…     1      5     16 "Pri…     4
#> 2  0.05 Placebo   Binary Benefit Primary Effica…     1      5     16 "Pri…     4
#> 3  0.2  Drug B    Binary Benefit Primary Effica…     5      4     16 ""        4
#> 4  0.06 Placebo   Binary Benefit Primary Effica…     5      4     16 ""        4
#> 5  0.46 Drug C    Binary Benefit Primary Effica…     9      3     16 ""        4
#> 6  0.04 Placebo   Binary Benefit Primary Effica…     9      3     16 ""        4
#> # ℹ 2 more variables: adjust_number <int>, mins_y <dbl>