Skip to content

add propensity to imports and handle importing namespace#47

Merged
malcolmbarrett merged 2 commits intomainfrom
attach_propensity
Aug 5, 2025
Merged

add propensity to imports and handle importing namespace#47
malcolmbarrett merged 2 commits intomainfrom
attach_propensity

Conversation

@malcolmbarrett
Copy link
Member

No description provided.

@malcolmbarrett malcolmbarrett requested a review from Copilot August 5, 2025 20:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds propensity to the package imports and improves handling of propensity score weighting (psw) objects by loading the propensity namespace automatically and replacing workarounds with proper API calls.

  • Added propensity to package imports in DESCRIPTION
  • Added namespace loading in .onLoad() to ensure psw S3 methods are available
  • Replaced inherits(x, "psw") checks with propensity::is_psw() calls
  • Removed vctrs::vec_data() workarounds that were previously needed for psw objects

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
DESCRIPTION Added propensity to package imports
R/zzz.R Added .onLoad function to load propensity namespace
R/utils-validation.R Updated psw object validation to use propensity::is_psw()
R/geom_roc.R Removed vctrs::vec_data() workaround from examples
R/geom_qq2.R Removed vctrs::vec_data() workaround from examples
man/geom_roc.Rd Updated documentation examples
man/geom_qq2.Rd Updated documentation examples
tests/testthat/test-extract_weight_data.R Updated test to use propensity::is_psw()
tests/testthat/test-compute_balance.R Updated tests to use propensity::is_psw()
tests/testthat/test-geom_roc.R Removed vctrs::vec_data() workaround
tests/testthat/test-geom_qq2.R Removed vctrs::vec_data() workaround

@malcolmbarrett malcolmbarrett merged commit 33ba280 into main Aug 5, 2025
8 checks passed
@malcolmbarrett malcolmbarrett deleted the attach_propensity branch August 5, 2025 20:33
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.

1 participant