write_jsonld: Write a list out as object to JSON-LD

View source: R/write_jsonld.R

write_jsonldR Documentation

Write a list out as object to JSON-LD

Description

Write a list out as object to JSON-LD

Usage

write_jsonld(x, path, context = "http://schema.org", pretty = TRUE,
  auto_unbox = TRUE, ...)

Arguments

x

an object to be serialized to JSON

path

file on disk

context

JSON-LD context; "http://schema.org"

pretty

adds indentation whitespace to JSON output. Can be TRUE/FALSE or a number specifying the number of spaces to indent. See prettify

auto_unbox

automatically unbox all atomic vectors of length 1. It is usually safer to avoid this and instead use the unbox function to unbox individual elements. An exception is that objects of class AsIs (i.e. wrapped in I()) are not automatically unboxed. This is a way to mark single values as length-1 arrays.

...

additional arguments passed to toJSON or fromJSON

Examples

x <- Thing(url = "http://schema.org")
tmp <- tempfile()
write_jsonld(x, tmp)


ropenscilabs/datasauce documentation built on May 17, 2022, 4:25 p.m.