Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/class-PKNCAresults.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,5 +138,5 @@ getGroups.PKNCAresults <- function(object,
#' from the PKNCAconc object within
#' @exportS3Method dplyr::group_vars
group_vars.PKNCAresults <- function(x) {
group_vars.PKNCAconc(as_PKNCAconc(x))
c(group_vars.PKNCAconc(as_PKNCAconc(x)),"start","end")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that in most of the rest of PKNCA, start and end are first. Can you please change the order so that they will come first? (That will also necessitate changing the tests.)

}
4 changes: 2 additions & 2 deletions tests/testthat/test-class-PKNCAresults.R
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,14 @@ test_that("group_vars.PKNCAresult", {
o_data_group <- PKNCAdata(o_conc_group, intervals = data.frame(start = 0, end = 1, cmax = TRUE))
suppressMessages(o_nca_group <- pk.nca(o_data_group))

expect_equal(dplyr::group_vars(o_nca_group), "Subject")
expect_equal(dplyr::group_vars(o_nca_group), c("Subject", "start", "end"))

# Check that it works without groupings as expected [empty]
o_conc_nongroup <- PKNCAconc(as.data.frame(datasets::Theoph)[datasets::Theoph$Subject == 1,], conc~Time)
o_data_nogroup <- PKNCAdata(o_conc_nongroup, intervals = data.frame(start = 0, end = 1, cmax = TRUE))
suppressMessages(o_nca_nogroup <- pk.nca(o_data_nogroup))

expect_equal(dplyr::group_vars(o_nca_nogroup), character(0))
expect_equal(dplyr::group_vars(o_nca_nogroup), c("start","end"))
})

test_that("as.data.frame.PKNCAresults can filter for only requested parameters", {
Expand Down
Loading