From 8938e2bf632544f3c5acb37792e670ca88346641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Mon, 21 Feb 2022 14:31:46 +0100 Subject: [PATCH] Correctly register pillar methods (#28) * Import pillar methods * Add ellipsis for https://github.com/r-lib/pillar/issues/250. Co-authored-by: Max Kuhn --- DESCRIPTION | 2 +- NAMESPACE | 6 ++++-- R/pillar.R | 11 ++--------- R/zzz.R | 2 +- man/pillar-helpers.Rd | 21 --------------------- 5 files changed, 8 insertions(+), 34 deletions(-) delete mode 100644 man/pillar-helpers.Rd diff --git a/DESCRIPTION b/DESCRIPTION index a02ff89..b247da7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,4 +52,4 @@ Config/testthat/edition: 3 Encoding: UTF-8 Language: en-US Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1.9000 +RoxygenNote: 7.1.2 diff --git a/NAMESPACE b/NAMESPACE index 98eacc9..834a403 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,7 +1,9 @@ # Generated by roxygen2: do not edit by hand +S3method(obj_sum,tune_race) S3method(print,control_race) S3method(print,control_sim_anneal) +S3method(size_sum,tune_race) S3method(tune_race_anova,default) S3method(tune_race_anova,formula) S3method(tune_race_anova,model_spec) @@ -19,9 +21,7 @@ S3method(tune_sim_anneal,recipe) S3method(tune_sim_anneal,workflow) export(control_race) export(control_sim_anneal) -export(obj_sum.tune_race) export(plot_race) -export(size_sum.tune_race) export(tune_race_anova) export(tune_race_win_loss) export(tune_sim_anneal) @@ -38,5 +38,7 @@ importFrom(stats,reorder) importFrom(stats,rnorm) importFrom(stats,runif) importFrom(stats,setNames) +importFrom(tibble,obj_sum) +importFrom(tibble,size_sum) importFrom(tibble,tibble) importFrom(utils,globalVariables) diff --git a/R/pillar.R b/R/pillar.R index c4458bc..04a2f07 100644 --- a/R/pillar.R +++ b/R/pillar.R @@ -1,8 +1,6 @@ #' @export -#' @keywords internal -#' @rdname pillar-helpers -obj_sum.tune_race <- function(x) { +obj_sum.tune_race <- function(x, ...) { null_metrics <- purrr::map_lgl(x$.metrics, is.null) if (!all(null_metrics)) { res <- "race[+]" @@ -12,13 +10,8 @@ obj_sum.tune_race <- function(x) { res } -#' Helpers for pillar formatting -#' @param x an object -#' @return A character string. #' @export -#' @keywords internal -#' @rdname pillar-helpers -size_sum.tune_race <- function(x) { +size_sum.tune_race <- function(x, ...) { "" } diff --git a/R/zzz.R b/R/zzz.R index a1a3ddf..26aebd5 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -1,7 +1,7 @@ #' @importFrom stats qt runif coef confint lm reorder rnorm setNames dist #' @importFrom utils globalVariables #' @importFrom rlang syms -#' @importFrom tibble tibble +#' @importFrom tibble tibble obj_sum size_sum #' @importFrom dplyr %>% distinct #' @importFrom utils globalVariables #' @import tune diff --git a/man/pillar-helpers.Rd b/man/pillar-helpers.Rd deleted file mode 100644 index 90099a8..0000000 --- a/man/pillar-helpers.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pillar.R -\name{obj_sum.tune_race} -\alias{obj_sum.tune_race} -\alias{size_sum.tune_race} -\title{Helpers for pillar formatting} -\usage{ -obj_sum.tune_race(x) - -size_sum.tune_race(x) -} -\arguments{ -\item{x}{an object} -} -\value{ -A character string. -} -\description{ -Helpers for pillar formatting -} -\keyword{internal}