Open jknizia opened 4 months ago
Adding a reprex of the issue:
library(tidyverse)
library(haven)
library(Tplyr)
adae <- haven::read_xpt(url("https://github.com/phuse-org/TestDataFactory/raw/main/Updated/TDF_ADaM/adae.xpt"))
# Create the Tplyr Table
t <- tplyr_table(adae, TRTA) %>%
add_layer(
group_count(vars(AEBODSYS, AEDECOD)) %>%
set_distinct_by(USUBJID) %>%
# Create nested formatting
add_risk_diff(
c('Xanomeline High Dose', 'Placebo'),
c('Xanomeline Low Dose', 'Placebo')
)
)
# Build the Tplyr table to get the data
# Suppress warning messages from risk difference calculations
t_df <- t %>% build()
Description
I am working on a function that creates a Tplyr table. One parameter expects a list of character vectors, containing comparison groups that will be passed on to the
add_risk_diff
function of {Tplyr}. The reason why the vectors are stored in a list is that I want to allow for specifying multiple comparisons. I then add the comparisons by means of thedo.call
function (see reprex below). I repeat this for two table layers. This worked perfectly fine with {Tplyr} version 1.1.0, however with version 1.2.0 and above I get the following error message:I add layers by using the
add_layers
function. The error only appears when I add both layers or only the second layer. When I add only the first layer, it works fine.Steps to Reproduce (Bug Report Only)
Here's a reproducible example:
Expected behavior: My approach works with {Tplyr} versions >= 1.1.0
Actual behavior: It crashes since version 1.2.0 (Note:
Versions
Note: Session Info lists {Tplyr} version 1.2.1, but I have tried it with 1.2.0 as well - same error.
Thanks for your help!