get_halflife_points method for PKNCAdata#476
Merged
billdenney merged 9 commits intohumanpred:mainfrom Nov 24, 2025
Merged
Conversation
billdenney
requested changes
Nov 6, 2025
| hl_col <- object$intervals$half.life | ||
| object$intervals <- object$intervals[hl_col & !is.na(hl_col),] | ||
|
|
||
| # Only calculate half.life for the results object |
Member
There was a problem hiding this comment.
I think that this can be simplified to something like:
group_cols <- names(getGroups(object))
object$intervals <- object$intervals[, c(group_cols, "start", "end", "half.life")]
Contributor
Author
There was a problem hiding this comment.
When groups are not specified in the intervals and I try to do this:
cols_to_keep <- intersect(names(object$intervals), c("start", "end", "half.life"))
object$intervals <- object$intervals[, cols_to_keep]
object$intervals <- unique(object$intervals)
o_nca <- pk.nca(object)
I get the next error:
Error in purrr::pmap(.l = list(data_conc = splitdata$data_conc, data_dose = splitdata$data_dose, :
ℹ In index: 1.
Caused by error in `if (interval[[n]]) ...`:
! Please report a bug.
: Error with interval start=0, end=Inf: argument is of length zero
Instead, I simplified by making FALSE other parameters:
params_to_ignore <- setdiff(names(get.interval.cols()), c("half.life", "start", "end"))
object$intervals[, params_to_ignore] <- FALSE
PS: Making them NA did not work either, so I just kept it simple as this does not affect the generation of the half.life result.
…iring half-life but not including half-life explicitly
…ife_points-method
Member
|
I wanted to check how one thing worked, and it worked as I expected (great work!). Merging when the tests complete. |
billdenney
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.