Skip to content

Conversation

@Gero1999
Copy link
Contributor

@Gero1999 Gero1999 commented Jul 8, 2025

Closes #445

Changes involve:

  • Added functions to normalize PK parameters based on a column in PKNCAconc (normalize_by_col) or using custom normalization tables (normalize).

  • Tests added to validate the behavior of normalization functions, including handling of missing groups, duplicate groups, and mismatched lengths

  • New vignette entry in post-processing to explain how to use these functions

@Gero1999 Gero1999 marked this pull request as ready for review July 9, 2025 20:00
@Gero1999
Copy link
Contributor Author

Gero1999 commented Jul 9, 2025

@billdenney let me know if this matches your idea for the normalization functions

@billdenney billdenney self-requested a review November 23, 2025 22:09
if (!col %in% obj_conc_cols) {
stop("Column ", col, " not found in the PKNCAconc of the PKNCAresults object")
}
conc_groups <- dplyr::group_vars(object$data$conc)
Copy link
Member

Choose a reason for hiding this comment

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

Please make group_vars() work on PKNCAresults objects, and use that. It is likely as simple as

#' @export
group_vars.PKNCAresults <- function(x) {
  group_vars(as_PKNCAconc(x))
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This already exists but I must admit I am actually pro-considering as group_vars for PKNCAresults also start, end and perhaps in the future PPANMETH to differentiate any parameter that may not be calculated in the same way (e.g, different impute)

So in my opinion should be that group_vars(PKNCAconc) != group_vars(PKNCAresults)

Copy link
Member

Choose a reason for hiding this comment

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

That makes sense (see the new issue). Can you please switch this to dplyr::group_vars(as_PKNCAconc(object)), then?

@Gero1999 Gero1999 marked this pull request as draft November 24, 2025 05:45
@Gero1999 Gero1999 marked this pull request as ready for review November 24, 2025 11:00
@Gero1999 Gero1999 requested a review from billdenney November 24, 2025 12:32
@billdenney
Copy link
Member

I'm going to move this on through without the minor style change I requested.

Thanks for the work @Gero1999 !

@billdenney billdenney merged commit abf1163 into humanpred:main Nov 24, 2025
9 checks passed
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: Weight normalized parameters

2 participants