Skip to content

Commit

Permalink
Merge pull request #220 from billdenney/release-prep
Browse files Browse the repository at this point in the history
Prepare for CRAN submission
  • Loading branch information
billdenney authored Apr 30, 2023
2 parents 7ab87da + 4856333 commit 9aab34d
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 12 deletions.
9 changes: 9 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -51,6 +59,7 @@ S3method(print,summary_PKNCAresults)
S3method(right_join,PKNCAconc)
S3method(right_join,PKNCAdose)
S3method(right_join,PKNCAresults)
S3method(setDuration,PKNCAconc)
S3method(setDuration,PKNCAdose)
S3method(setRoute,PKNCAdose)
S3method(signifString,data.frame)
Expand Down
5 changes: 5 additions & 0 deletions R/class-PKNCAconc.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
Expand Down Expand Up @@ -265,6 +266,7 @@ group_vars.PKNCAconc <- function(x) {
}

#' @rdname getDataName
#' @export
getDataName.PKNCAconc <- function(object) {
if (is_sparse_pk(object)) {
"data_sparse"
Expand All @@ -273,6 +275,8 @@ getDataName.PKNCAconc <- function(object) {
}
}

#' @rdname setDuration
#' @export
setDuration.PKNCAconc <- function(object, duration, ...) {
if (missing(duration)) {
object <-
Expand Down Expand Up @@ -364,6 +368,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)
}
Expand Down
1 change: 1 addition & 0 deletions R/class-PKNCAdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
11 changes: 8 additions & 3 deletions R/class-PKNCAdose.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions R/class-PKNCAresults.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion R/pk.calc.urine.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pk.calc.ae <- function(conc, volume, check=TRUE) {
} else if (any(mask_missing_vol)) {
message_vol <- sprintf("%g of %g volumes are missing", sum(mask_missing_vol), length(conc))
}
message_all <- na.omit(c(message_both, message_conc, message_vol))
message_all <- stats::na.omit(c(message_both, message_conc, message_vol))
ret <- sum(conc*volume)
if (length(message_all) != 0) {
message <- paste(message_all, collapse = "; ")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- badges: start -->
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/PKNCA)](https://cran.r-project.org/package=PKNCA)
[![R-CMD-check](https://github.com/billdenney/pknca/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/billdenney/pknca/actions/workflows/R-CMD-check.yaml)
[![Code_Coverage_Badge](https://codecov.io/github/billdenney/pknca/coverage.svg?branch=main)](https://codecov.io/github/billdenney/pknca?branch=main)
[![Code_Coverage_Badge](https://codecov.io/github/billdenney/pknca/coverage.svg?branch=main)](https://app.codecov.io/github/billdenney/pknca?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/billdenney/pknca/badge?style=plastic)](https://www.codefactor.io/repository/github/billdenney/pknca)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2054/badge)](https://bestpractices.coreinfrastructure.org/projects/2054)
<!-- badges: end -->
Expand Down
6 changes: 3 additions & 3 deletions man/group_vars.PKNCAconc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions man/setDuration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9aab34d

Please sign in to comment.