From 96a544a6e726865c0ca78c66a86f3eef722e136d Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 4 Oct 2023 12:23:59 +0200 Subject: [PATCH] lintr --- R/r2.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/r2.R b/R/r2.R index 0f066a5be..f3e2b7b6c 100644 --- a/R/r2.R +++ b/R/r2.R @@ -748,10 +748,10 @@ r2.mmclogit <- function(model, ...) { #' @export r2.Arima <- function(model, ...) { - if (!requireNamespace("forecast", quietly = TRUE)) { - list(R2 = NA) - } else { + if (requireNamespace("forecast", quietly = TRUE)) { list(R2 = stats::cor(stats::fitted(model), insight::get_data(model, verbose = FALSE))^2) + } else { + list(R2 = NA) } }