metrumresearchgroup / pmtables

TeX tables for pharmacometrics.
https://metrumresearchgroup.github.io/pmt-book
11 stars 1 forks source link

Arguments are not captured when coercing pmtable output to stable_long #203

Closed kylebaron closed 3 years ago

kylebaron commented 3 years ago

Summary

As a user, I want to be able to convert pmtable output to long table and pass along arguments to stable_long

Tests

kylebaron commented 3 years ago

When you make a pmtable like this and want to coerce to long table

pmt_first %>% pt_cont_long(cols = "WT, ALB, SCR") %>% stable_long()

You should be able to pass in arguments to stable_long() (like a caption)

pmt_first %>% pt_cont_long(cols = "WT, ALB, SCR") %>% stable_long(lt_cap_text = "A caption")

That isn't working right now after refactoring stable_long to be generic.

The workaround is

x <- pt_cont_long(pmt_first, cols = "WT, ALB, SCR")
x$lt_cap_text <- "my caption"
do.call(what = stable_long, args = x)