From e1ed6988b5ee6682060a79374f38f5c3fff9fe76 Mon Sep 17 00:00:00 2001 From: nteetor Date: Tue, 21 Jan 2020 15:10:26 -0500 Subject: [PATCH] fix(r): new utils, deprecated msg, typo --- NAMESPACE | 1 + R/button.R | 6 +++--- R/design-scroll.R | 2 +- R/utils.R | 9 ++++----- R/yonder.R | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 25b700e6..09a0568d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -163,6 +163,7 @@ export(width) import(rlang) importFrom(htmltools,HTML) importFrom(htmltools,attachDependencies) +importFrom(htmltools,div) importFrom(htmltools,findDependencies) importFrom(htmltools,htmlDependency) importFrom(htmltools,resolveDependencies) diff --git a/R/button.R b/R/button.R index ac282537..0f7e07c0 100644 --- a/R/button.R +++ b/R/button.R @@ -288,11 +288,11 @@ updateLinkInput <- function(id, label = NULL, value = NULL, buttonGroupInput <- function(..., id, choices = NULL, values = choices, labels = deprecated(), direction = "horizontal") { - if (is_present(labels)) { + if (!is_missing(labels)) { deprecate_soft( "0.2.0", - "buttonGroupInput(labels = )", - "buttonGroupInput(choices = )" + "yonder::buttonGroupInput(labels = )", + "yonder::buttonGroupInput(choices = )" ) choices <- labels diff --git a/R/design-scroll.R b/R/design-scroll.R index 18b867f4..76a7d523 100644 --- a/R/design-scroll.R +++ b/R/design-scroll.R @@ -8,7 +8,7 @@ #' #' @param direction One of `"horizontal"` or `"vertical"` specifying which #' direction to scroll overflowing content, defaults to `"vertical"`, in which -#' case the content may croll up and down. +#' case the content may scroll up and down. #' #' @family design utilities #' @export diff --git a/R/utils.R b/R/utils.R index e1e36634..8a87c18e 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,6 +1,10 @@ # necessary for `createRenderFunction()` globalVariables("func") +reduce <- function(x, f, init) { + Reduce(f, x, init) +} + drop_nulls <- function(x) { if (length(x) == 0) { x @@ -9,11 +13,6 @@ drop_nulls <- function(x) { } } -# Included until rlang exports `is_present()` -is_present <- function(arg) { - !is_missing(maybe_missing(arg)) -} - str_conjoin <- function(x, con = "or") { if (length(x) == 1) { return(as.character(x)) diff --git a/R/yonder.R b/R/yonder.R index 13be1c15..0bdf511c 100644 --- a/R/yonder.R +++ b/R/yonder.R @@ -1,5 +1,5 @@ #' @importFrom htmltools HTML htmlDependency attachDependencies -#' suppressDependencies resolveDependencies findDependencies tags +#' suppressDependencies resolveDependencies findDependencies tags div #' tagAppendAttributes tagAppendChildren surroundSingletons takeSingletons #' @importFrom shiny observe getDefaultReactiveDomain installExprFunction #' createRenderFunction createWebDependency