-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
getQuote fails if any symbols are not found #279
Comments
I think the main jist of the fix is to replace line 59: if I can find some time, I'll try cruft up a pr |
Thanks for the report and patch! Your suggestion is very close, but wouldn't quite work because It might also be good to only do the merge conditioned on So something like: if (length(Symbols) != NROW(sq)) {
sq <- merge(data.frame(symbol = Symbols, stringsAsFactors = FALSE),
sq, by = "symbol", all = TRUE)
} Please double-check that works, and make a PR when you're ready. Thanks! |
This was fixed in #282. Closing. |
For some reason, calling fromJSON() directly throws errors with long symbol lists. Thanks to @ethanbsmith for the report and patch. See #279.
Add a 'Symbol' column the output of all the 'method' functions. Remove initial uppercase and 'std.cols' handling in 'tiingo' method. These weren't used, and were deleted to be easier to maintain and to avoid future confusion. See #279. Closes #288. Squashed commit of the following: commit 0541c4d Author: Joshua Ulrich <josh.m.ulrich@gmail.com> Date: Sun Nov 24 14:44:21 2019 -0600 Revert "Update getQuote.R" This reverts commit 5ff4cd6. commit 5ff4cd6 Author: ethanbsmith <24379655+ethanbsmith@users.noreply.github.com> Date: Sat Nov 23 13:49:12 2019 -0700 Update getQuote.R fixed column name commit 28b581b Author: Joshua Ulrich <josh.m.ulrich@gmail.com> Date: Sat Nov 23 11:18:59 2019 -0600 Avoid implicit conversion and overwriting args Also fix typo in Tiingo column name and address whitespace/formatting. commit 23d5f16 Author: ethanbsmith <24379655+ethanbsmith@users.noreply.github.com> Date: Fri Nov 22 16:00:23 2019 -0700 Update getQuote.R commit 2223a5d Author: ethanbsmith <24379655+ethanbsmith@users.noreply.github.com> Date: Fri Nov 22 15:58:45 2019 -0700 Update tests.R added test for batch size and correct row labeling commit 8f83d8c Author: ethanbsmith <24379655+ethanbsmith@users.noreply.github.com> Date: Fri Nov 22 15:50:31 2019 -0700 Update getQuote.R moved coumn name and missing row handling into master function commit 41cc351 Author: ethanbsmith <24379655+ethanbsmith@users.noreply.github.com> Date: Fri Nov 22 15:10:03 2019 -0700 explicit curl call explicitly call curl::curl. for some unknown reasosn the direct call to fromJSON causes erros with long symbol lists
Quotes were returned with Symbols sorted in lexical order. That made it hard to write tests. It also seems reasonable to expect that the output would be in the same order as the input. See #279.
Description
getQuote.yahoo fails if yahoo does not recognize any of the symbols. This is particularly problematic when a very large list of quotes is requested as identifying the offending symbol is near impossible. Since the identifying Symbol may be perfectly valid, but yahoo just doesn't recognize it. eg:
DEENF which is a valid OTC ticker:
https://www.otcmarkets.com/stock/DEENF/overview
Expected behavior
ideally getQuote would return the values for the found symbols and NAs for the ones that weren't found
Minimal, reproducible example
Session Info
The text was updated successfully, but these errors were encountered: