Skip to content
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

error when using tbl_regression() with broom.helpers:: scope_tidy() #287

Closed
nataliejcameron opened this issue Jan 28, 2025 · 3 comments
Closed

Comments

@nataliejcameron
Copy link

I have run into an issue running tbl_regression() for a coxph model. It was working perfectly prior to the recent broom.helpers update, but now won't run without throwing the following error message:
Error in scope_tidy():
! The .$x data frame does not have the required "variable" column.

Backtrace:

  1. +-base (local) '' (x)
    2.+- gtsummary:::print.gtsummary(x)

  2. | +-... %>% print()
    4.| \ -gtsummary:: as gt (x)
    5.| -broom.helpers::.select_to_varnames (...)
    6.| \broom.helpers::scope tidy(var_info, data)
    7.| -cli::cli_abort("The .code Sx) data frame does not have the required (.val variable) column.")
    8.| -rlang::abort(....)

  3. | -base: print(.)

I can't copy and paste my full code as I'm working in a remote data safe haven with confidential data, but another user on stackexchange seems to have reported a similar issue today:https://github.com/larmarange/broom.helpers/issues/275

Apologies if this is not formatted well, it's my first time using github.

@ddsjoberg
Copy link
Collaborator

I can't copy and paste my full code as I'm working in a remote data safe haven with confidential data

You don't need to provide the exact data you're using. Please check out https://reprex.tidyverse.org/, which will illustrate how to create a minimal reproducible example, that is, the minimal code+data needed to replicate your issue. You can often use a small subset of your data using dput() or even a small subset that has random noise added to it to preserve confidentiality.

@larmarange
Copy link
Owner

Thank you @ddsjoberg

Dear @nataliejcameron we need an example to reproduce the error. It does not have to be your exact data, but a similar model and code where the same error occurs.

@nataliejcameron
Copy link
Author

Thank you - I've solved the issue myself by uninstalling gtsummary() and broom.helpers(), restarting my R session and then reinstalling them - please feel free to close this query. Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants