Create a complete PFA document as a list-of-lists. Composing with the JSON function creates a PFA file on disk.
pfa_document(input, output, action, cells = NULL, pools = NULL,
fcns = NULL, validate = FALSE, name = NULL, method = NULL,
begin = NULL, end = NULL, zero = NULL, merge = NULL,
randseed = NULL, doc = NULL, version = NULL, metadata = NULL,
options = NULL, env = parent.frame())input schema, which is an Avro schema as list-of-lists (created by avro_* functions)
output schema, which is an Avro schema as list-of-lists (created by avro_* functions)
R commands wrapped as an expression (see R's built-in expression function)
named list of cell specifications (see the pfa_cell function)
named list of pool specifications (see the pfa_cell function)
named list of R commands, wrapped as expressions
a logical indicating whether the generated PFA document should
be validated using Titus-in-Aurelius function pfa_engine
optional name for the scoring engine (string)
"map", "emit", "fold", or NULL (for "map")
R commands wrapped as an expression
R commands wrapped as an expression
list-of-lists representing the initial value for a "fold"'s tally
R commands wrapped as an expression
optional random number seed (integer) for ensuring that the scoring engine is deterministic
optional model documentation string
optional model version number (integer)
optional named list of strings to store model metadata
optional list-of-lists to specify PFA options
environment for resolving unrecognized symbols as substitutions
a list of lists representing a complete PFA document
pfa_document(avro_double, avro_double, expression(input + 10))
Run the code above in your browser using DataLab