bfast2 / bfast2/bfast

Error in if (is.nan(p0) || p0 < a2 || p0 > (1 - a2)) {: missing value where TRUE/FALSE needed

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
R
Stars
53
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Equivalent of https://github.com/bfast2/strucchange/issues/18 in bfast01, with a trivial reproducer:

``` r
library(bfast)
bfast01(data = Nile)
#> Error in if (is.nan(p0) || p0 < a2 || p0 > (1 - a2)) {: missing value where TRUE/FALSE needed
```

Created on 2020-03-27 by the [reprex package](https://reprex.tidyverse.org) (v0.3.0)

Blame: https://github.com/bfast2/bfast/blob/f58ba97a3dc2b98ea06f265a10f81c19c823c323/R/bfast01.R#L462

But really should just depend on strucchange to not duplicate code.

Contributor guide

Open the contributing guide

Research direction

Start with the reproducer in the issue and inspect R/bfast01.R around line 462, where the failing condition is identified. Compare the duplicated logic with the linked strucchange issue and determine how bfast should rely on strucchange instead. Done means bfast01(data = Nile) no longer raises the missing-value error and the relevant behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.