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

standard evaluation errors? #22

Open
yina opened this issue Sep 28, 2020 · 1 comment
Open

standard evaluation errors? #22

yina opened this issue Sep 28, 2020 · 1 comment

Comments

@yina
Copy link

yina commented Sep 28, 2020

This problem is so simple but I can't seem to figure it out. I have some very simple code to interact with the bing web search api.

query <- "depression icd 10"
mkt <- "en-US"

hits <- api("https://api.cognitive.microsoft.com") %>%
  api_path(bing, v7.0, search) %>%
  api_headers('Ocp-Apim-Subscription-Key' = 'fake') %>%
  api_query_(q = bquote(.(query)), count = 20) %>%
  peep

It produces an error:

> hits <- api("https://api.cognitive.microsoft.com") %>%
+   api_path(bing, v7.0, search) %>%
+   api_headers('Ocp-Apim-Subscription-Key' = 'fake') %>%
+   api_query_(q = bquote(.(query)), count = 20) %>%
+   peep
Error in parse(text = x) : <text>:1:12: unexpected symbol
1: depression icd
@sckott
Copy link
Owner

sckott commented Sep 28, 2020

Sorry about that. The query should be quoted like "'depression icd 10'", with single quotes inside the double quotes. I probably should fix the lazy eval internals, but for now you can make it work by doing that quoting

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

2 participants