-
Notifications
You must be signed in to change notification settings - Fork 29
get_halflife_points method for PKNCAdata #476
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
get_halflife_points method for PKNCAdata #476
Conversation
| hl_col <- object$intervals$half.life | ||
| object$intervals <- object$intervals[hl_col & !is.na(hl_col),] | ||
|
|
||
| # Only calculate half.life for the results object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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")]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
I wanted to check how one thing worked, and it worked as I expected (great work!). Merging when the tests complete. |
No description provided.