Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bfastts: error if time series contains leap day #15

Open
GreatEmerald opened this issue Oct 22, 2018 · 0 comments
Open

bfastts: error if time series contains leap day #15

GreatEmerald opened this issue Oct 22, 2018 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@GreatEmerald
Copy link
Collaborator

If we have the leap day (Feb 29) and also the day after (March 1) in the time series, bfastts fails with an error:

Error in merge.zoo(zoo(coredata(x), tt), zoo(, tt2)) : 
  series cannot be merged with non-unique index entries in a series
In addition: Warning messages:
1: In zoo(data, 1900 + as.POSIXlt(dates)$year + (yday365(dates) - 1)/365,  :
  some methods for “zoo” objects do not work if the index entries in ‘order.by’ are not unique

MWE:
Fails:

a = c(as.Date("2016-02-29"), as.Date("2016-03-01"))
b = 1:2
bfastts(b, a, type="irregular")

Works if we set it to be one day later:

a = c(as.Date("2016-02-29"), as.Date("2016-03-01"))
b = 1:2
bfastts(b, a+1, type="irregular")
@GreatEmerald GreatEmerald added bug Something isn't working help wanted Extra attention is needed labels Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant