loadj: JSON Load

Description Usage Arguments Details Value Examples

View source: R/load.r

Description

Load a JSON file into an R list

Usage

1
loadj(file, encoding = "UTF-8")

Arguments

file

character. A JSON file connection.

encoding

character. Encoding method to use. Defaults to UTF-8.

Details

This function provides a simple interface to load a JSON file, meanwhile prints some loading information.

Value

list. The loading result.

Examples

1
2
3
4
5
library(mojson)
j <- list(a = list(1, 2), b = 3)
tf <- tempfile()
writeLines(RJSONIO::toJSON(j), tf)
loadj(tf)

mojson documentation built on Feb. 11, 2021, 5:07 p.m.