From c569af43692988377736085f62b516e44212d697 Mon Sep 17 00:00:00 2001 From: Andrew Dolman Date: Thu, 3 Oct 2024 18:54:18 +0200 Subject: [PATCH] make k = 3 default for SpecACF --- R/SpecACF.R | 2 +- man/SpecACF.Rd | 4 ++-- tests/testthat/test-SpecACF.R | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/SpecACF.R b/R/SpecACF.R index 355edd5..dace8c0 100644 --- a/R/SpecACF.R +++ b/R/SpecACF.R @@ -120,7 +120,7 @@ #' ) SpecACF <- function(x, deltat = NULL, bin.width = NULL, - k = 1, nw = 0, + k = 3, nw = 2, demean = TRUE, detrend = TRUE, TrimNA = TRUE, pos.f.only = TRUE, diff --git a/man/SpecACF.Rd b/man/SpecACF.Rd index 31749d4..a26a491 100644 --- a/man/SpecACF.Rd +++ b/man/SpecACF.Rd @@ -9,8 +9,8 @@ SpecACF( x, deltat = NULL, bin.width = NULL, - k = 1, - nw = 0, + k = 3, + nw = 2, demean = TRUE, detrend = TRUE, TrimNA = TRUE, diff --git a/tests/testthat/test-SpecACF.R b/tests/testthat/test-SpecACF.R index 85efa78..40bdcf7 100644 --- a/tests/testthat/test-SpecACF.R +++ b/tests/testthat/test-SpecACF.R @@ -26,7 +26,7 @@ test_that("SpecACF", { expect_equal(sp1_tap$dof, rep(3*2, length(sp1_tap$freq))) # test for neg freq - sp2 <- SpecACF(ts1, bin.width = 1, pos.f.only = FALSE) + sp2 <- SpecACF(ts1, bin.width = 1, k = 1, pos.f.only = FALSE) expect_s3_class(sp2, "spec") @@ -39,7 +39,7 @@ test_that("SpecACF", { m <- matrix(rnorm(3*100), ncol = 3) - spm <- SpecACF(m, bin.width = 1) + spm <- SpecACF(m, bin.width = 1, k = 1) #LPlot(spm) @@ -56,7 +56,7 @@ test_that("SpecACF", { # do not demean - sp1ndm <- SpecACF(rnorm(100, mean = 100), bin.width = 1, demean = FALSE, + sp1ndm <- SpecACF(rnorm(100, mean = 100), bin.width = 1, k = 1, demean = FALSE, detrend = FALSE, return.working = TRUE, pos.f.only = FALSE) expect_true(mean(sp1ndm$working$x) > 90) expect_true(sp1ndm$spec[1] > sp2$spec[1])