Skip to content
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

Create set_intervals() and assert_intervals() functions #329

Closed
billdenney opened this issue Oct 28, 2024 · 2 comments
Closed

Create set_intervals() and assert_intervals() functions #329

billdenney opened this issue Oct 28, 2024 · 2 comments
Assignees

Comments

@billdenney
Copy link
Owner

This pair of functions will set the intervals for a PKNCAdata object and verify that the intervals are valid, given the object.

set_intervals <- function(data, intervals) {} will take in two objects, the PKNCAdata object and the proposed intervals. It will then check that the intervals are valid, given the data object. If the intervals are valid, it will set them in the object. It will return the data object with the intervals set.

assert_intervals <- function(intervals, data) {} will verify that an interval definition is valid for a PKNCAdata object. Valid means that intervals are a data.frame (or data.frame-like object), that the column names are either the groupings of the PKNCAconc part of the PKNCAdata object or that they are one of the NCA parameters allowed (i.e. names(get.interval.cols())). It will return the intervals argument unchanged, or it will raise an error.

set_intervals() will be called to set the intervals within PKNCAdata(); assert_intervals() should be called both within set_intervals() and in assert_PKNCAdata() (see #328).

@billdenney
Copy link
Owner Author

Be sure that you can handle both grouped and ungrouped conc data. For example:

library(PKNCA)

o_conc <- PKNCAconc(as.data.frame(datasets::Theoph), conc~Time|Subject)
names(getGroups(o_conc))

o_conc <- PKNCAconc(as.data.frame(datasets::Theoph)[datasets::Theoph$Subject == 1,], conc~Time)
names(getGroups(o_conc))

@billdenney
Copy link
Owner Author

Completed in #335

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

No branches or pull requests

2 participants