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.
- Host: GitHub
- URL: https://github.com/stla/jsonnormalize
- Owner: stla
- Created: 2023-05-23T11:10:57.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-24T17:04:17.000Z (almost 3 years ago)
- Last Synced: 2026-02-21T03:56:41.228Z (4 months ago)
- Topics: json, r, rstudio-addin
- Language: R
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
Awesome Lists containing this project
README
---
title: "jsonNormalize"
output: github_document
---
[](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)
```