bfast2 / bfast2/bfast

bfast01: stl="both" results in an empty formula

Open
#43 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.