Description
Hi,
I'm having errors on the following script with webr 0.2.2, which works fine on R standalone installation.
install.packages("gtsummary")
gtsummary::trial |> gtsummary::tbl_strata(
strata = c(grade),
.tbl_fun = ~ .x |> gtsummary::tbl_summary(by = trt) |> gtsummary::add_overall(last = T),
.header = "**{strata}**, N = {n}"
) |> gtsummary::as_gt() |> gt::as_raw_html(F)
This procudes the following error:
Uncaught (in promise) Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
at captureR (blob:https://localhost:9000/1f4eb65b-40f0-468b-bb99-d2ee8c23bbd0:4727:15)
at evalR (blob:https://localhost:9000/1f4eb65b-40f0-468b-bb99-d2ee8c23bbd0:4739:19)
at PostMessageChannelWorker.dispatch (blob:https://localhost:9000/1f4eb65b-40f0-468b-bb99-d2ee8c23bbd0:4365:28)
at PostMessageChannelWorker. (blob:https://localhost:9000/1f4eb65b-40f0-468b-bb99-d2ee8c23bbd0:3024:44)
Removing the following part solves the issue but I don't get why:
|> gtsummary::add_overall(last = T)
With some variations, sometimes I get a different error:
payload.ts:39 Uncaught (in promise) Error: In argument: tbl = switch(...)
.
at captureR (blob:https://localhost:9000/b614354a-8ee1-4b1b-947f-f1c0a62bc18a:4727:15)
at evalR (blob:https://localhost:9000/b614354a-8ee1-4b1b-947f-f1c0a62bc18a:4739:19)
at PostMessageChannelWorker.dispatch (blob:https://localhost:9000/b614354a-8ee1-4b1b-947f-f1c0a62bc18a:4365:28)
at PostMessageChannelWorker. (blob:https://localhost:9000/b614354a-8ee1-4b1b-947f-f1c0a62bc18a:3024:44)