cstawitz / roomba Goto Github PK
View Code? Open in Web Editor NEWGeneral purpose API response tidier
Home Page: https://cstawitz.github.io/roomba/index.html
License: Other
General purpose API response tidier
Home Page: https://cstawitz.github.io/roomba/index.html
License: Other
Consider using usethis
anytime I use roomba and using xml2 package without roomba (I had to uninstall to use xml2 properly):
Warning messages:
1: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
2: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
3: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
4: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
can't bind rows
Hello roomba
team, excellent work!
This is a minor suggestion to move the hexsticker up to the level of the package name in the README, to match e.g. the janitor package (among others):
If there's support for this, I would be happy to put in a PR, along the lines of:
# roomba <img src="./img/sticker.png" height="200px" align="right" />
x <- '{
"stuff": {
"buried": {
"deep": [
{
"goodstuff": "here",
"name": "Bob Rudis",
"secret_power": 5
},
{
"goodstuff": "here",
"name": "Amanda Dobbyn",
"secret_power": 4,
"more_nested_stuff": 4
}
],
"alsodeep": 2342423234,
"deeper": {
"foo": [
{
"goodstuff": 5,
"name": "barb"
}
]
}
}
}}'
Right now the shiny app is hardwired to work with specific values returned from the twitter data. Should eventually be smart about figuring out what's a date item.
Returns list names that contain values (or are null only)
Hi, thanks for a great package. I get the following error when installing roomba. @bretsw got the same error when doing this, too.
> devtools::install_github("ropenscilabs/roomba")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo ropenscilabs/roomba@HEAD
These packages have more recent versions available.
It is recommended to update all of them.
Which would you like to update?
1: All
2: CRAN packages only
3: None
4: dplyr (1.0.0 -> 1.0.1) [CRAN]
Enter one or more numbers, or an empty line to skip updates:
✓ checking for file ‘/private/var/folders/xd/xrgmmrv97355mcjtmjqcr72w0000gp/T/RtmpY8sBFU/remotes81353287bca2/ropenscilabs-roomba-ef3b84f/DESCRIPTION’ ...
─ preparing ‘roomba’:
✓ checking DESCRIPTION meta-information ...
Warning in grepl(e, files, perl = TRUE, ignore.case = TRUE) :
PCRE pattern compilation error
'unrecognized character follows \'
at 'images$'
Error in grepl(e, files, perl = TRUE, ignore.case = TRUE) :
invalid regular expression '^\images$'
Execution halted
Error: Failed to install 'roomba' from GitHub:
System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/private/var/folders/xd/xrgmmrv97355mcjtmjqcr72w0000gp/T/RtmpY8sBFU/remotes81353287bca2/ropenscilabs-roomba-ef3b84f/DESCRIPTION’ ... OK
E> * preparing ‘roomba’:
E> * checking DESCRIPTION meta-information ... OK
E> Warning in grepl(e, files, perl = TRUE, ignore.case = TRUE) :
E> PCRE pattern compilation error
E> 'unrecognized character follows \'
E> at 'images$'
E> Error in grepl(e, files, perl = TRUE, ignore.case = TRUE) :
E> invalid regular expression '^\images$'
E> Execution halted
>
This package is very exciting, great work! Our dataspice
team was thrilled to see how nicely it already handles common requests on a dataspice.json
file, e.g.:
library(roomba)
json <- jsonlite::read_json("https://raw.githubusercontent.com/ropenscilabs/dataspice/master/inst/metadata-tables/dataspice.json")
## Works nicely when all columns come from same level of nesting:
json %>% roomba(c("givenName", "familyName"))
json %>% roomba(c("value", "unitText", "description"))
It would be great if the cols
argument could take a named list that could also rename the output columns on the fly:
json %>% roomba(c("value", units = "unitText", "description")),
I am writing an R API package and, playing with roomba, it will save me a bunch of thinking and lines of code to snarf the data I want. What is your reaction to me wanting to depend on roomba?
I guess that's a general question so more specifically, how likely is it that roomba would make it to CRAN some day and how far away from CRAN-ready is it?
And then other options I see are, I could build initially with roomba and then later replace with more explicit parsing of the nested data, or house roomba code internally to the package.
I love this package and value your opinions about how to appropriately make the most of it! 🙏
reddit <- jsonlite::fromJSON("data/topknitting.json", simplifyVector = FALSE)
y_reddit <- reddit %>% roomba:::replace_null()
y_reddit %>% dfs_idx(~ length(.x$title) > 0) %>%
purrr:::map_dfr(~ y_reddit[[.x]])
Error in bind_rows_(x, .id) : Argument 39 must be length 1, not 2
This package is very exciting, great work! Our dataspice
team was thrilled to see how nicely it already handles common requests on a dataspice.json
file, e.g.:
library(roomba)
json <- jsonlite::read_json("https://raw.githubusercontent.com/ropenscilabs/dataspice/master/inst/metadata-tables/dataspice.json")
## Works nicely when all columns come from same level of nesting:
json %>% roomba(c("givenName", "familyName"))
json %>% roomba(c("value", "unitText", "description"))
But not clear how to get a repeated column from a different level of nesting:
json %>% roomba(c("value", "unitText", "description", "box"))
Probably requires some kind of notation to indicate the different levels, e.g. in this case maybe something like
json %>% roomba(c("variableMeasured.value",
"variableMeasured.unitText",
"variableMeasured.description",
"spatialCoverage.geo.box"))
would be possible?
👋 @jimhester @aedobbyn @ldecicco-USGS @ivelasq @cstawitz according to our recently created package curation policy this repo should now be transferred to either one of your personal accounts, or the ropensci-archive organization.
If you don't answer within one month, I'll transfer the repository to ropensci-archive, after which you could still email me to transfer the repo to a personal account.
Thank you!
Maybe this requires another argument like keep_all_rows
.
In the example below, I think we should allow the user some way to end up with 4 rows instead of 3. The third row corresponding to baz
should be all NA
s.
It would be useful in cases I can imagine for the user to know that they got 4 distinct outputs back and that one of them was fully null.
library(magrittr)
some_json <- '
{
"foo": [{
"a": 1,
"b": 2,
"c": 3
}],
"bar":[{
"a": 4,
"b": null,
"c": 6
}],
"baz": [],
"bing":[{
"c": 12
}]
}
'
lst <- some_json %>% jsonlite::fromJSON()
lst %>% roomba::roomba(cols = c("a", "b", "c"), keep = any)
#> a b c
#> 1 1 2 3
#> 2 4 NA 6
#> 3 NA NA 12
So what I think this should look like is:
#> a b c
#> 1 1 2 3
#> 2 4 NA 6
#> 3 NA NA NA
#> 4 NA NA 12
Mostly useful when the user knows they're passing x number inputs to an API and expecting x outputs, even if some of those outputs are empty.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.