https://github.com/mtmorgan/rjsoncons
  
  
     
    https://github.com/mtmorgan/rjsoncons
  
        Last synced: 22 days ago 
        JSON representation
    
- Host: GitHub
 - URL: https://github.com/mtmorgan/rjsoncons
 - Owner: mtmorgan
 - Created: 2021-02-16T10:31:12.000Z (over 4 years ago)
 - Default Branch: main
 - Last Pushed: 2024-09-10T17:46:28.000Z (about 1 year ago)
 - Last Synced: 2025-09-19T17:48:08.214Z (about 2 months ago)
 - Language: C++
 - Homepage: https://mtmorgan.github.io/rjsoncons/
 - Size: 9.28 MB
 - Stars: 8
 - Watchers: 3
 - Forks: 0
 - Open Issues: 0
 - 
            Metadata Files:
            
- Readme: README.md
 - Changelog: NEWS.md
 
 
Awesome Lists containing this project
- jimsghstars - mtmorgan/rjsoncons - (C++)
 
README
          # rjsoncons
[](https://CRAN.R-project.org/package=rjsoncons)

This package provides functions to query (filter or transform), pivot
(convert from array-of-objects to object-of-arrays, for easy import as
'R' data frame), search, patch (edit), and validate (against [JSON
Schema][]) 'JSON' and 'NDJSON' strings, files, or URLs. Query and
pivot support [JSONpointer][], [JSONpath][] or [JMESpath][]
expressions. The implementation uses the [jsoncons][] header-only
library; the library is easily linked to other packages for direct
access to 'C++' functionality not implemented here.
[JSON Schema]: https://json-schema.org
[JSONpath]: https://goessner.net/articles/JsonPath/
[JMESpath]: https://jmespath.org/
[JSONpointer]: https://datatracker.ietf.org/doc/html/rfc6901
## Installation and loading
Install the released package version from CRAN
``` r
install.packages("rjsoncons", repos = "https://CRAN.R-project.org")
```
Install the development version with
``` r
if (!requireNamespace("remotes", quiety = TRUE))
    install.packages("remotes", repos = "https://CRAN.R-project.org")
remotes::install_github("mtmorgan/rjsoncons")
```
Attach the installed package to your *R* session with
``` r
library(rjsoncons)
```
[jsoncons]: https://github.com/danielaparker/jsoncons/
[rjsoncons]: https://mtmorgan.github.io/rjsoncons/
## Use cases
The [introductory vignette][] outlines common use cases, including:
- Filter large JSON or NDJSON documents to extract records or elements
  of interest.
- Extract deeply nested elements.
- Transform data for more direct incorporation in *R* data structures.
- 'Patch' JSON strings programmatically, e.g., to update HTTP request
  payloads.
- Validate JSON documents against JSON schemas
The [jsoncons][] C++ header-only library is a very useful starting
point for advanced JSON manipulation. The vignette outlines how
[rjsoncons][] can be used by other *R* packages wishing to access the
C++ library.
## Next steps
See the [introductory vignette][] for additional details.
[introductory vignette]: https://mtmorgan.github.io/rjsoncons/articles/a_rjsoncons.html