Skip to content

Commit

Permalink
streamline more() and look()
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Dec 8, 2023
1 parent 4da7416 commit 9b48e6a
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
#'
Expand All @@ -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
#'
Expand Down

0 comments on commit 9b48e6a

Please sign in to comment.