rethomics / zeitgebr

Circadian rhythm analysis and visualisation in R
11 stars 7 forks source link

Error on Lomb::lsp when data is a series of zeros #2

Closed pepelisu closed 6 years ago

pepelisu commented 7 years ago

The function periodogram does not check for dead animals, or for series that are full of ceros. When that series is fed to the lomb::lsp function it complains with:

Error in if (p > 0.01) p <- 1 - (1 - exPN)^effm : 
  missing value where TRUE/FALSE needed 
qgeissmann commented 7 years ago

maybe we should raise a warning and fill the periodogram values with NA when there length(unique(x)) <2