-
Notifications
You must be signed in to change notification settings - Fork 182
Open
Description
Most recent day often returns non-unique values which returns a warning. Problem is with the yahoo extract in the first place via quantmod then passed on to tq_get().
Suggest to amend tq_get just before the return(ret) last line to include:
if (identical(get, "stock.prices")) {
ret <- ret %>%
dplyr::group_by(symbol, date) %>%
dplyr::summarise(open = dplyr::last(open),
high = dplyr::last(high),
low = dplyr::last(low),
close = dplyr::last(close),
volume = dplyr::last(volume),
adjusted = dplyr::last(adjusted)) %>%
dplyr::ungroup()
}
At times yahoo finance returns duplicate last day and at other times everything is the same with the exception of volume. Hence the approach above instead of dplyr::distinct().
Metadata
Metadata
Assignees
Labels
No labels