Skip to contents

Both read_json_js() and read_json_jo() read JSON from a file or an URL. Function read_json_js() returns a string, while read_json_jo() returns an object of class jsonlite::class-json.

Usage

read_json_js(txt = NULL)

read_json_jo(txt = NULL)

Arguments

txt

A file name or URL

Examples

if (FALSE) {
url <- paste("http://localhost", "ocpu/library/jamesdemodata",
  "extdata/bds_v2.0/smocc/Laura_S.json", sep = "/")
fn <- system.file("extdata", "bds_v2.0", "smocc", "Laura_S.json",
 package = "jamesdemodata", mustWork = TRUE)
fn <- system.file("extdata", "allegrosultum", "client3.json",
 package = "jamesdemodata", mustWork = TRUE)
js1 <- read_json_js(url)
js2 <- read_json_js(fn)
jo1 <- read_json_jo(url)
jo2 <- read_json_jo(fn)
}