Skip to content

Commit

Permalink
make k = 3 default for SpecACF
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdolman committed Oct 3, 2024
1 parent b284b25 commit c569af4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/SpecACF.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions man/SpecACF.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions tests/testthat/test-SpecACF.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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)

Expand All @@ -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])
Expand Down

0 comments on commit c569af4

Please sign in to comment.