From e88f6cf3c42feecd59f17d32cef6d8d811dec93d Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Thu, 2 Nov 2023 11:15:21 +0000 Subject: [PATCH] updates look() --- DESCRIPTION | 2 +- NEWS.md | 2 ++ R/utils.R | 7 ++++--- man/look.Rd | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2925110f..8026756d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: ichimoku Type: Package Title: Visualization and Tools for Ichimoku Kinko Hyo Strategies -Version: 1.4.10 +Version: 1.4.10.9000 Description: An implementation of 'Ichimoku Kinko Hyo', also commonly known as 'cloud charts'. Static and interactive visualizations with tools for creating, backtesting and development of quantitative 'ichimoku' strategies. diff --git a/NEWS.md b/NEWS.md index 56379f34..80a47605 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# ichimoku 1.4.10.9000 (development) + # ichimoku 1.4.10 * Improves handling of OANDA API errors. diff --git a/R/utils.R b/R/utils.R index 14b51d29..1cd42ff0 100644 --- a/R/utils.R +++ b/R/utils.R @@ -310,10 +310,11 @@ df_append <- function(old, new, key = "time", keep.attr = "timestamp") { #' #' @export #' -look <- function(x) { +look <- function(x = .Last.value) { - lk <- .Call(ichimoku_look, if (missing(x)) .Last.value else x) - if (length(lk)) lk else invisible() + lk <- .Call(ichimoku_look, x) + is.null(lk) && return(invisible()) + lk } diff --git a/man/look.Rd b/man/look.Rd index 5aa812a6..8ab705d0 100644 --- a/man/look.Rd +++ b/man/look.Rd @@ -4,7 +4,7 @@ \alias{look} \title{Look at Informational Attributes} \usage{ -look(x) +look(x = .Last.value) } \arguments{ \item{x}{an object (optional). If 'x' is not supplied, \code{\link{.Last.value}}