diff --git a/NAMESPACE b/NAMESPACE index 67ecafc0..c50d947a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -13,6 +13,8 @@ S3method(PKNCAdose,tbl_df) S3method(as.data.frame,PKNCAconc) S3method(as.data.frame,PKNCAdose) S3method(as.data.frame,PKNCAresults) +S3method(dplyr::group_vars,PKNCAconc) +S3method(dplyr::group_vars,PKNCAdose) S3method(exclude,default) S3method(filter,PKNCAconc) S3method(filter,PKNCAdose) @@ -22,6 +24,9 @@ S3method(formula,PKNCAdose) S3method(full_join,PKNCAconc) S3method(full_join,PKNCAdose) S3method(full_join,PKNCAresults) +S3method(getDataName,PKNCAconc) +S3method(getDataName,PKNCAdose) +S3method(getDataName,PKNCAresults) S3method(getDepVar,PKNCAconc) S3method(getDepVar,PKNCAdose) S3method(getGroups,PKNCAconc) @@ -35,6 +40,9 @@ S3method(group_by,PKNCAresults) S3method(inner_join,PKNCAconc) S3method(inner_join,PKNCAdose) S3method(inner_join,PKNCAresults) +S3method(is_sparse_pk,PKNCAconc) +S3method(is_sparse_pk,PKNCAdata) +S3method(is_sparse_pk,PKNCAresults) S3method(left_join,PKNCAconc) S3method(left_join,PKNCAdose) S3method(left_join,PKNCAresults) diff --git a/R/class-PKNCAconc.R b/R/class-PKNCAconc.R index ff206cba..bb2a4bbc 100644 --- a/R/class-PKNCAconc.R +++ b/R/class-PKNCAconc.R @@ -203,6 +203,7 @@ formula.PKNCAconc <- function(x, ...) { #' order. #' @export #' @importFrom stats model.frame +#' @method model.frame PKNCAconc model.frame.PKNCAconc <- function(formula, ...) { formula$data[, all.vars(formula$formula), drop=FALSE] } @@ -265,6 +266,7 @@ group_vars.PKNCAconc <- function(x) { } #' @rdname getDataName +#' @export getDataName.PKNCAconc <- function(object) { if (is_sparse_pk(object)) { "data_sparse" @@ -364,6 +366,7 @@ print.PKNCAconc <- function(x, n=6, summarize=FALSE, ...) { } #' @rdname is_sparse_pk +#' @export is_sparse_pk.PKNCAconc <- function(object) { "data_sparse" %in% names(object) } diff --git a/R/class-PKNCAdata.R b/R/class-PKNCAdata.R index 95b44afb..9f7ab6de 100644 --- a/R/class-PKNCAdata.R +++ b/R/class-PKNCAdata.R @@ -191,6 +191,7 @@ PKNCAdata.default <- function(data.conc, data.dose, ..., } #' @rdname is_sparse_pk +#' @export is_sparse_pk.PKNCAdata <- function(object) { is_sparse_pk(object$conc) } diff --git a/R/class-PKNCAdose.R b/R/class-PKNCAdose.R index 2ae2f271..10d0d12f 100644 --- a/R/class-PKNCAdose.R +++ b/R/class-PKNCAdose.R @@ -50,12 +50,14 @@ PKNCAdose <- function(data, ...) #' @rdname PKNCAdose #' @export -PKNCAdose.default <- function(data, ...) +PKNCAdose.default <- function(data, ...) { PKNCAdose.data.frame(as.data.frame(data), ...) +} #' @rdname PKNCAdose #' @export -PKNCAdose.tbl_df <- function(data, ...) +PKNCAdose.tbl_df <- function(data, ...) { PKNCAdose.data.frame(as.data.frame(data), ...) +} #' @rdname PKNCAdose #' @export @@ -242,6 +244,7 @@ formula.PKNCAdose <- function(x, ...) { #' @rdname model.frame.PKNCAconc #' @export #' @importFrom stats model.frame +#' @method model.frame PKNCAdose model.frame.PKNCAdose <- function(formula, ...) { cbind(getDepVar.PKNCAdose(formula), getIndepVar.PKNCAdose(formula), @@ -281,8 +284,10 @@ group_vars.PKNCAdose <- function(x) { } #' @rdname getDataName -getDataName.PKNCAdose <- function(object) +#' @export +getDataName.PKNCAdose <- function(object) { "data" +} #' @rdname print.PKNCAconc #' @export diff --git a/R/class-PKNCAresults.R b/R/class-PKNCAresults.R index 238b8cd1..aa4cdfa5 100644 --- a/R/class-PKNCAresults.R +++ b/R/class-PKNCAresults.R @@ -59,11 +59,13 @@ as.data.frame.PKNCAresults <- function(x, ..., out.format=c('long', 'wide')) { } #' @rdname getDataName +#' @export getDataName.PKNCAresults <- function(object) { "result" } #' @rdname is_sparse_pk +#' @export is_sparse_pk.PKNCAresults <- function(object) { is_sparse_pk(object$data) } diff --git a/man/group_vars.PKNCAconc.Rd b/man/group_vars.PKNCAconc.Rd index 10161985..f19127af 100644 --- a/man/group_vars.PKNCAconc.Rd +++ b/man/group_vars.PKNCAconc.Rd @@ -5,9 +5,9 @@ \alias{group_vars.PKNCAdose} \title{Get grouping variables for a PKNCA object} \usage{ -\method{group_vars}{PKNCAconc}(x) +group_vars.PKNCAconc(x) -\method{group_vars}{PKNCAdose}(x) +group_vars.PKNCAdose(x) } \arguments{ \item{x}{The PKNCA object} @@ -20,6 +20,6 @@ Get grouping variables for a PKNCA object } \section{Functions}{ \itemize{ -\item \code{group_vars(PKNCAdose)}: Get group_vars for a PKNCAdose object +\item \code{group_vars.PKNCAdose()}: Get group_vars for a PKNCAdose object }}