-
Notifications
You must be signed in to change notification settings - Fork 13
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
jq() paste bare numbers together #79
Comments
thanks for this @mgirlich jq expects JSON as the input as the documentation states, so this works as expected i think jq(jsonlite::toJSON(c("1", "2")))
#> [
#> "1",
#> "2"
#> ] |
bare numbers are also valid json (see standard and try out at jsonlint). x <- jqr::jq(c('{"a": 1}', '{"a": 2}'), '.a')
x
#> [
#> 1,
#> 2
#> ]
jqr::jq(x)
#> 12 Created on 2020-01-27 by the reprex package (v0.3.0) |
@jeroen any thoughts on this issue. seems that it shouldn't combine the numbers together
|
@mgirlich Sorry about the delay. We have limited bandwidth to work on this. Fastest way is if you have submit a PR with a fix/change |
Hello, I encountered a similar strange behavior with arrays of numbers:
|
thanks @stla but the above eg is not reproducible. what are |
Ah yes, sorry.
|
that is weird. if you do it all in one go it turns out as expected i think: str <- '{"2019-01-01T00:00:14":102,"2019-01-01T00:01:15":123}'
w <- str %>% index() %>% tostring()
w
#> [
#> "102",
#> "123"
#> ] can you do it that way? |
The following code returns "12" instead of "1" and "2" separately
Created on 2020-01-24 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: