write_pfa {aurelius}R Documentation

write_pfa

Description

Convert a PFA list of lists into a JSON string in memory or a JSON file on disk.

Usage

write_pfa(doc, file = "", force = TRUE, auto_unbox = TRUE,
  pretty = FALSE, digits = 8, ...)

Arguments

doc

The document to convert.

file

a string representing file path to write to. If ” then the string of JSON is returned

force

a logical indicating to unclass/skip objects of classes with no defined JSON mapping

auto_unbox

a logical indicating to automatically unbox all atomic vectors of length 1

pretty

a logical indicating to add indentation whitespace to JSON output.

digits

max number of decimal digits to print for numeric values. Use I() to specify significant digits. Use NA for max precision.

...

additional arguments passed to toJSON

Examples

## Not run: 
my_pfa_doc <- pfa_document(avro_double, avro_double, expression(input + 10))
write_pfa(my_pfa_doc)
write_pfa(my_pfa_doc, file = "my-model.pfa")

## End(Not run)

[Package aurelius version 0.8.4 Index]