iexcloudR icon indicating copy to clipboard operation
iexcloudR copied to clipboard

historyFor error - "Column name `symbol` must not be duplicated."

Open dkincaid opened this issue 5 years ago • 0 comments

Describe the bug Running the example in the README: historyFor("AAPL") returns an error (actually any symbol I use is returning the same error.

Error: Column name `symbol` must not be duplicated.

To Reproduce Steps to reproduce the behavior:

library(iexcloudR)
historyFor("AAPL")

Expected behavior a tibble is returned with the history for AAPL stock

Error details

> rlang::last_error()
█
├─<error/tibble_error_column_names_must_be_unique>
│ Column name `symbol` must not be duplicated.
└─<error/vctrs_error_names_must_be_unique>
  Names must be unique.
Backtrace:
  1. iexcloudR::historyFor("AAPL")
  2. tibble::as_tibble(do.call(rbind, data))
  9. tibble::add_column(., symbol = symbol, .before = 1)
 10. tibble:::set_repaired_names(out, .name_repair)
 12. tibble:::repaired_names(...)
 15. vctrs::vec_as_names(...)
 17. vctrs:::validate_unique(names = names, arg = arg)
 18. vctrs:::stop_names_must_be_unique(names, arg)
 19. vctrs:::stop_names(...)
 20. vctrs:::stop_vctrs(class = c(class, "vctrs_error_names"), ...)
> rlang::last_trace()
█
├─<error/tibble_error_column_names_must_be_unique>
│ Column name `symbol` must not be duplicated.
└─<error/vctrs_error_names_must_be_unique>
  Names must be unique.
Backtrace:
     █
  1. └─iexcloudR::historyFor("AAPL")
  2.   └─`%>%`(...)
  3.     ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  4.     └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
  5.       └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
  6.         └─iexcloudR:::`_fseq`(`_lhs`)
  7.           └─magrittr::freduce(value, `_function_list`)
  8.             └─function_list[[i]](value)
  9.               └─tibble::add_column(., symbol = symbol, .before = 1)
 10.                 └─tibble:::set_repaired_names(out, .name_repair)
 11.                   ├─rlang::set_names(...)
 12.                   └─tibble:::repaired_names(...)
 13.                     ├─tibble:::subclass_name_repair_errors(...)
 14.                     │ └─base::withCallingHandlers(...)
 15.                     └─vctrs::vec_as_names(...)
 16.                       └─(function () ...
 17.                         └─vctrs:::validate_unique(names = names, arg = arg)
 18.                           └─vctrs:::stop_names_must_be_unique(names, arg)
 19.                             └─vctrs:::stop_names(...)
 20.                               └─vctrs:::stop_vctrs(class = c(class, "vctrs_error_names"), ...)

dkincaid avatar Dec 17 '20 00:12 dkincaid