Closed stevecondylios closed 4 years ago
make_dates() has a bug
make_dates()
This probably occurs when exactly 365 days (and probably exact multiples too) between from and to (note the identical start/end date in api_time_splits()
from
to
api_time_splits()
library(priceR) library(tidyverse) library(lubridate) historical_exchange_rates("AUD", "USD", today() - 365, today()) historical_exchange_rates("AUD", "USD", "2019-07-30", "2020-07-29") start_date = "2019-07-30" end_date = "2020-07-29" api_time_splits <- priceR:::make_dates(start_date, end_date, 365) # start_date end_date # 1 2019-07-30 2020-07-29 # 2 2020-07-29 2020-07-29
This should instead be
# start_date end_date # 1 2019-07-30 2020-07-28 # 2 2020-07-29 2020-07-29
Note that the row with the same start and end date is fine (the API handles such queries without issue).
The only problem here is the doubling up on the end date of the first time segment ( / start of next time segment)
make_dates()
has a bugThis probably occurs when exactly 365 days (and probably exact multiples too) between
from
andto
(note the identical start/end date inapi_time_splits()
This should instead be
Note that the row with the same start and end date is fine (the API handles such queries without issue).
The only problem here is the doubling up on the end date of the first time segment ( / start of next time segment)