tidyverts / tsibble

Tidy Temporal Data Frames and Tools
https://tsibble.tidyverts.org
GNU General Public License v3.0
528 stars 50 forks source link

fixes missing 'by' in seq.yearmonth() #228

Closed jmarshallnz closed 3 years ago

jmarshallnz commented 3 years ago

Currently if a yearmonth column is present in a tsibble, using seq on it without specifying by results in an error

Error in bad_by(by) : argument "by" is missing, with no default

Due to seq.yearmonth() calling bad_by(by).

However, the by argument is not required by seq generally (as length.out could be instead) and nor is it required for seq.yearmonth (or seq.yearquarter).

There may be a more elegant method of fixing this, but I figure having a potential fix is better than not! I'm happy to reimplement however you like (and do the same for seq.yearquarter as necessary).

earowang commented 3 years ago

Thanks. Looks great! Can you send a new PR on fixing seq.yearquarter() and seq.yearweek() with a couple of unit tests? Please add yourself to one of our contributors in the PR too.

jmarshallnz commented 3 years ago

Sure, happy to do so over the weekend.