Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tq_mutate problem #231

Open
fibrou opened this issue Apr 27, 2023 · 0 comments
Open

tq_mutate problem #231

fibrou opened this issue Apr 27, 2023 · 0 comments

Comments

@fibrou
Copy link

fibrou commented Apr 27, 2023

tq_mutate() is generating an intermittent error when mutating downloaded symbols from an index.

dowSymbols <- tq_index("DOW") %>%
  select(symbol)
 
dowReturns <- tq_get(dowSymbols, from = "2017-01-01", to = "2022-12-31") %>%
   group_by(symbol) %>%
   tq_mutate(select = adjusted, periodReturn, period = "daily", type = "arithmetic")

The traceback error indicates the following:

Error in merge_two_tibbles(tib1 = data, tib2 = ret, mutate_fun) : Could not join. Incompatible structures.

6. stop("Could not join. Incompatible structures.")
5. merge_two_tibbles(tib1 = data, tib2 = ret, mutate_fun)
4. tq_mutate_.tbl_df(data = data, select = lazyeval::expr_text(select), mutate_fun = lazyeval::expr_text(mutate_fun), col_rename = col_rename, ... = ...)
3. tq_mutate_(data = data, select = lazyeval::expr_text(select), mutate_fun = lazyeval::expr_text(mutate_fun), col_rename = col_rename, ... = ...)
2. tq_mutate(., select = adjusted, periodReturn, period = "daily", type = "arithmetic")
1. tq_get(dowSymbols, from = "2017-01-01", to = "2022-12-31") %>% group_by(symbol) %>% tq_mutate(select = adjusted, periodReturn, period = "daily", type = "arithmetic")

Any sense as to what might be happening with tq-mutate()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant