rjsoncons

CRAN status CRAN downloads

The jsoncons C++ header-only library constructs representations from a JSON character vector, and provides extensions for flexible queries and other operations on JSON objects. This package provides ‘R’ functions to query (filter or transform) and pivot (convert from array-of-objects to object-of-arrays, for easy import into ‘R’) ‘JSON’ or ‘NDJSON’ strings or files using JSONpath, JMESpath, and JSONpointer expressions. The package also makes it easy to use C++ ‘jsoncons’ in other R packages for direct access to ‘C++’ functionality.

Installation and loading

Install the released package version from CRAN

install.packages("rjsoncons", repos = "https://CRAN.R-project.org")

Install the development version with

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

library(rjsoncons)

Use cases

The introductory vignette outlines common use cases, including:

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.