Skip to content

Update g_forest() to support col_x and col_ci in the same column. - #1507

Open
wwojciech wants to merge 11 commits into
pharmaverse:mainfrom
wwojciech:1499_g_forest_estCI_single_col
Open

Update g_forest() to support col_x and col_ci in the same column.#1507
wwojciech wants to merge 11 commits into
pharmaverse:mainfrom
wwojciech:1499_g_forest_estCI_single_col

Conversation

@wwojciech

Copy link
Copy Markdown
Contributor

Fixes #1499

@wwojciech

Copy link
Copy Markdown
Contributor Author

Hi @danielinteractive , @gmbecker - Can you pl. review this new PR? Thank you!

@danielinteractive danielinteractive left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @wwojciech please see my question below

Comment thread R/g_forest.R
Comment thread tests/testthat/test-g_forest.R
@wwojciech

Copy link
Copy Markdown
Contributor Author

Thanks @danielinteractive , please see the update code.

@wwojciech

Copy link
Copy Markdown
Contributor Author

Hi @danielinteractive - I had to update the code to ensure backward compatibility, specifically to allow col_x or col_ci to be NULL, hiding x or ci when the point estimate and CI share a column.

If you have a chance, could you please take a look at the updated code?

Comment thread R/g_forest.R Outdated
Comment thread R/g_forest.R Outdated
Comment thread R/g_forest.R Outdated

@Melkiades Melkiades left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all it looks good to me!! Thanks for the addition @wwojciech. Once Daniel approves we can proceed

@danielinteractive danielinteractive left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still prefer to have the assertion as well. Reason: If this code is changed in the future ... then this logic might be broken. And you will not see it easily because the code will still run.

@wwojciech

Copy link
Copy Markdown
Contributor Author

I would still prefer to have the assertion as well. Reason: If this code is changed in the future ... then this logic might be broken. And you will not see it easily because the code will still run.

Sure, thanks, @danielinteractive. Would the below assertion be sufficient for this purpose?

# We essentially need to check the number of columns in `x_ci` (if it is not NULL).
checkmate::assert_matrix(x_ci, min.cols = 2, null.ok = TRUE)

@wwojciech

Copy link
Copy Markdown
Contributor Author

Thank you @danielinteractive.
@Melkiades - can you pl. approve it, (Daniel has just approved it). Thanks!

@wwojciech
wwojciech requested a review from Melkiades August 12, 2026 12:46
@wwojciech

Copy link
Copy Markdown
Contributor Author

Hi @Melkiades - can you pl. have a look at this PR, Thanks!

@Melkiades

Copy link
Copy Markdown
Contributor

Hi @Melkiades - can you pl. have a look at this PR, Thanks!

Good to go for me! But cannot merge it or approve it... @shajoezhu could you take a look into this?

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

Successfully merging this pull request may close these issues.

[Feature Request]: g_forest() to support point estimates and confidence intervals stored in a single column

3 participants