-
Notifications
You must be signed in to change notification settings - Fork 16
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Newly introduced error when adding multiple risk difference comparisons at once #182
Labels
bug
Something isn't working
Comments
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!
The text was updated successfully, but these errors were encountered: