bfast01: stl="both" results in an empty formula
- Dominant language
- R
- Stars
- 53
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Running bfast01(stl="both") always results in an error:
``` r
library(bfast)
mts = ts(1:10, 2000, 2011, frequency=20)
bfast01(mts, stl="both")
#> Error in parse(text = x, keep.source = FALSE): :2:0: unexpected end of input
#> 1: response ~
#> ^
```
Created on 2019-12-04 by the [reprex package](http://reprex.tidyverse.org) (v0.2.0).
This is because the corresponding component is removed from the formula, and "both" removes both of them, resulting in an empty formula.
I don't know what the fix should be: either not allow passing "both", or perhaps not filter the components out.
Contributor guide
Research direction
Start by running the reported bfast01(mts, stl="both") reproducer and inspect how bfast01 builds and filters its formula components. Decide whether stl="both" should be rejected or handled differently, then ensure the call no longer produces an empty-formula parse error and add coverage for the chosen behavior.
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
- Needs clarification
- Newbie friendliness
- 35/100