An open API service indexing awesome lists of open source software.

https://github.com/stla/jsonnormalize

Normalize JSON strings.
https://github.com/stla/jsonnormalize

json r rstudio-addin

Last synced: 2 months ago
JSON representation

Normalize JSON strings.

Awesome Lists containing this project

README

          

---
title: "jsonNormalize"
output: github_document
---

[![R-CMD-check](https://github.com/stla/jsonNormalize/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/stla/jsonNormalize/actions/workflows/R-CMD-check.yaml)

Normalize JSON strings.

___

```{r jsonHook, include=FALSE}
knitr::knit_hooks$set(output = function(x, options) {
paste0(c("```json", x, "```"), collapse = "\n")
})
```

```{r, comment=""}
library(jsonNormalize)

badJstring <- "
[
{ 01: false, 999: true, },
{
area: 30,
thirty: '30',
ind: [5, 4.1, 3.7 , 1e3,],
'cluster' : true ,
\"999\": false,
city: 'London'
},
[ null, undefined, NaN],
{
'null': null,
'undefined': undefined,
'NaN': NaN
}
]"
goodJstring <- jsonNormalize(badJstring, prettify = TRUE)
cat(goodJstring)
```