atorus-research / Tplyr

https://atorus-research.github.io/Tplyr/
Other
95 stars 17 forks source link

`get_meta_result()` and `get_meta_subset()` should gracefully error with invalid ellipsis params #102

Closed mstackhouse closed 8 months ago

mstackhouse commented 2 years ago
t <- tplyr_table(adsl, TRT01P) %>% 
  add_layer(
    group_count(AGEGR1, by = vars("Age Group by Sex n (%)", SEX))
  ) 

dat <- t %>% 
  build(metadata=TRUE)

get_meta_result(t, "c1_1", "var1_Placebo", "var1_Xanomeline High Dose")
mstackhouse commented 2 years ago

This should throw an error because of invalid ellipsis content, but instead the ellipsis is just discarded and no error is encountered.

asbates commented 10 months ago

@mstackhouse Should this be an error or a warning? I would think warning because it's not wrong per se but they should know the dots are ignored.

mstackhouse commented 10 months ago

I lean towards error because the syntax is technically wrong. If the syntax is right but the behavior is potentially unexpected, I'd want to warn - but there's not a reason you should leave the invalid syntax so I just want refuse to let the action happen. Does that make sense?