Skip to contents

Breadth-first search over the transform fx_transforms() registry for the shortest composition of read_/convert_/write_ steps that takes a value from the input format to the desired one. Returns the path, or a result marked not transformable when no such path exists ("if you can get there from here").

Usage

fx_plan_transform(from, to, registry = NULL)

Arguments

from, to

fx_format() descriptors.

registry

A transform-edge list; defaults to fx_transforms().

Value

An fx_plan: a list with transformable (logical), path (the ordered edges), from, to, and reason (when not transformable).

Examples

fx_plan_transform(fx_format("temperature", "celsius", "C"),
                  fx_format("temperature", "fahrenheit", "F"))
#> <fx_plan: read_celsius :: convert_C_F :: write_fahrenheit>