How to read JSON in R where values is a list? Need help parsing nested data! or Struggling to read JS

16 Replies, 1865 Views

Pro tip: `rjson` is another option for read json in r where values is a list. It’s less aggressive with flattening than `jsonlite`, so you might have more control.

For nested stuff, I write tiny helper functions with `[[` to drill down. Like:
```
get_nested <- function(x, path) {
Reduce(`[[`, path, init = x)
}
```

Works like a charm!

Messages In This Thread



Users browsing this thread: 1 Guest(s)