From d5abdce38ffa6d04e9a4c47388a55943567400a2 Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Wed, 8 Mar 2023 07:23:18 -0600 Subject: [PATCH 1/5] compiled generic consistency --- R/compile.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/compile.R b/R/compile.R index 91f30759..01ccf136 100644 --- a/R/compile.R +++ b/R/compile.R @@ -1,4 +1,4 @@ -# Copyright (C) 2013 - 2019 Metrum Research Group, LLC +# Copyright (C) 2013 - 2023 Metrum Research Group # # This file is part of mrgsolve. # @@ -130,7 +130,7 @@ compiled <- function(x,...) UseMethod("compiled") #' @export compiled.default <- function(x,...) return(FALSE) #' @export -compiled.mrgmod <- function(x,status=NULL) { +compiled.mrgmod <- function(x, status = NULL, ...) { if(is.null(status)) return(x@shlib$compiled) x@shlib$compiled <- status return(x) From 5ac2eb77b377b3fe500891ac318d256e4dad8d3e Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Wed, 8 Mar 2023 11:15:21 -0600 Subject: [PATCH 2/5] update as_tibble.mrgsims method so signature matches generic --- DESCRIPTION | 2 +- R/mrgsims.R | 21 +++++++++++++++++---- man/mrgsims_dplyr.Rd | 14 +++++++++++++- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3681a4aa..8f32070c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: mrgsolve Title: Simulate from ODE-Based Models -Version: 1.0.8.9000 +Version: 1.0.8.9001 Authors@R: c(person(given = "Kyle T", family = "Baron", role = c("aut", "cre"), diff --git a/R/mrgsims.R b/R/mrgsims.R index 1675ce7e..c42b5801 100644 --- a/R/mrgsims.R +++ b/R/mrgsims.R @@ -241,10 +241,23 @@ as_data_frame.mrgsims <- function(.data_,...) { as_tibble(as.data.frame(.data_),...) } -##' @rdname mrgsims_dplyr -##' @export -as_tibble.mrgsims <- function(.data_,...) { - as_tibble(as.data.frame(.data_),...) +#' @param .rows passed to [tibble::as_tibble()] +#' @param .name_repair passed to [tibble::as_tibble()] +#' @param rownames passed to [tibble::as_tibble()] +#' @rdname mrgsims_dplyr +#' @export +as_tibble.mrgsims <- function(x, + .rows = NULL, + .name_repair = c("check_unique", "unique", + "universal", "minimal"), + rownames = NULL, ...) { + as_tibble( + as.data.frame(x), + .rows = .rows, + .name_repair = .name_repair, + rownames = rownames, + ... + ) } #' @rdname mrgsims_dplyr diff --git a/man/mrgsims_dplyr.Rd b/man/mrgsims_dplyr.Rd index 085b640c..a9fc8ada 100644 --- a/man/mrgsims_dplyr.Rd +++ b/man/mrgsims_dplyr.Rd @@ -39,7 +39,13 @@ as_data_frame.mrgsims(.data_, ...) -\method{as_tibble}{mrgsims}(.data_, ...) +\method{as_tibble}{mrgsims}( + x, + .rows = NULL, + .name_repair = c("check_unique", "unique", "universal", "minimal"), + rownames = NULL, + ... +) as.tbl.mrgsims(x, ...) } @@ -61,6 +67,12 @@ as.tbl.mrgsims(x, ...) \item{.data_}{mrgsims object} \item{x}{passed to \link[dplyr:tbl_df]{dplyr::as.tbl}} + +\item{.rows}{passed to [tibble::as_tibble()]} + +\item{.name_repair}{passed to [tibble::as_tibble()]} + +\item{rownames}{passed to [tibble::as_tibble()]} } \description{ These methods modify the data in a mrgsims object and return a data frame. From 39df8177ec6c8219681455ab0d722babd488a081 Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Wed, 8 Mar 2023 22:11:27 -0600 Subject: [PATCH 3/5] fix generics --- R/mrgsims.R | 25 +++++++------------------ man/mrgsims_dplyr.Rd | 20 +++----------------- 2 files changed, 10 insertions(+), 35 deletions(-) diff --git a/R/mrgsims.R b/R/mrgsims.R index c42b5801..bc5bc0bd 100644 --- a/R/mrgsims.R +++ b/R/mrgsims.R @@ -235,29 +235,18 @@ slice.mrgsims <- function(.data,...) { } ##' @rdname mrgsims_dplyr -##' @param .data_ mrgsims object ##' @export -as_data_frame.mrgsims <- function(.data_,...) { - as_tibble(as.data.frame(.data_),...) +as_data_frame.mrgsims <- function(x,...) { + as_tibble(as.data.frame(x),...) } -#' @param .rows passed to [tibble::as_tibble()] -#' @param .name_repair passed to [tibble::as_tibble()] -#' @param rownames passed to [tibble::as_tibble()] + +#' @param x mrgsims object. +#' #' @rdname mrgsims_dplyr #' @export -as_tibble.mrgsims <- function(x, - .rows = NULL, - .name_repair = c("check_unique", "unique", - "universal", "minimal"), - rownames = NULL, ...) { - as_tibble( - as.data.frame(x), - .rows = .rows, - .name_repair = .name_repair, - rownames = rownames, - ... - ) +as_tibble.mrgsims <- function(x, ...) { + as_tibble(as.data.frame(x), ...) } #' @rdname mrgsims_dplyr diff --git a/man/mrgsims_dplyr.Rd b/man/mrgsims_dplyr.Rd index a9fc8ada..cac3f29d 100644 --- a/man/mrgsims_dplyr.Rd +++ b/man/mrgsims_dplyr.Rd @@ -37,15 +37,9 @@ \method{slice}{mrgsims}(.data, ...) -as_data_frame.mrgsims(.data_, ...) +as_data_frame.mrgsims(x, ...) -\method{as_tibble}{mrgsims}( - x, - .rows = NULL, - .name_repair = c("check_unique", "unique", "universal", "minimal"), - rownames = NULL, - ... -) +\method{as_tibble}{mrgsims}(x, ...) as.tbl.mrgsims(x, ...) } @@ -64,15 +58,7 @@ as.tbl.mrgsims(x, ...) \item{.dots}{passed to various \code{dplyr} functions} -\item{.data_}{mrgsims object} - -\item{x}{passed to \link[dplyr:tbl_df]{dplyr::as.tbl}} - -\item{.rows}{passed to [tibble::as_tibble()]} - -\item{.name_repair}{passed to [tibble::as_tibble()]} - -\item{rownames}{passed to [tibble::as_tibble()]} +\item{x}{mrgsims object.} } \description{ These methods modify the data in a mrgsims object and return a data frame. From cc9c313d4e11f1964f18016e1e67300b9a7062a2 Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Thu, 9 Mar 2023 08:00:41 -0600 Subject: [PATCH 4/5] NEWS --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index 46cee27f..88aa08e0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # mrgsolve (development version) +- Fix signatures for `compile()` and `as_tibble()` methods based on new R-devel + check findings (#1065). + # mrgsolve 1.0.8 - `SIGMA()` is a new model macro which allows users to access on-diagonal From 6e9a361d84cfcd99ceb280984ce6f612ea1450a8 Mon Sep 17 00:00:00 2001 From: Kyle Baron Date: Thu, 9 Mar 2023 08:02:51 -0600 Subject: [PATCH 5/5] re-phrase news --- NEWS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 88aa08e0..19fe8ec2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ # mrgsolve (development version) -- Fix signatures for `compile()` and `as_tibble()` methods based on new R-devel - check findings (#1065). +- Fix signatures for `compiled.mrgmod()` and `as_tibble.mrgsims()` based on new + R-devel check findings (#1065). # mrgsolve 1.0.8