From 9b48e6aa9f9fd1d91fddf4effac02feb0ef821af Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Fri, 8 Dec 2023 11:29:35 +0000 Subject: [PATCH] streamline more() and look() --- R/utils.R | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/R/utils.R b/R/utils.R index 6a5ca1ed..4724f4da 100644 --- a/R/utils.R +++ b/R/utils.R @@ -310,13 +310,7 @@ df_append <- function(old, new, key = "time", keep.attr = "timestamp") { #' #' @export #' -look <- function(x = .Last.value) { - - lk <- .Call(ichimoku_look, x) - is.null(lk) && return(invisible()) - lk - -} +look <- function(x = .Last.value) if (length(lk <- .Call(ichimoku_look, x))) lk #' Print More Rows of Ichimoku Objects #' @@ -339,13 +333,10 @@ look <- function(x = .Last.value) { #' #' @export #' -more <- function(rows) { - - is.ichimoku(lv <- .Last.value) || return(invisible()) - print(lv, plot = FALSE, - rows = if (missing(rows) || !is.numeric(rows)) attr(lv, "dim")[1L] else rows) - -} +more <- function(rows) + if (is.ichimoku(lv <- .Last.value)) + print(lv, plot = FALSE, + rows = if (missing(rows) || !is.numeric(rows)) attr(lv, "dim")[1L] else rows) #' is.ichimoku #'