Saves a Recipe object to a file in JSON format.
Usage
save_recipe(recipe, file)
Arguments
- recipe
A Recipe object.
- file
A character string specifying the file path.
Details
This function encodes the Recipe object
and writes it to a JSON file.
See also
Other recipes:
Recipe-class,
add_recipe(),
bake_recipes(),
explore_recipes(),
get_recipe(),
harmonize(),
print.Recipe(),
publish_recipe(),
read_recipe(),
recipe(),
steps_to_recipe()
Examples
r <- recipe(
name = "Example", user = "Test",
svy = survey_empty(type = "ech", edition = "2023"),
description = "Example recipe"
)
f <- tempfile(fileext = ".json")
save_recipe(r, f)
#> The recipe has been saved in /tmp/RtmpIjFxAI/file1e0750a2fbba.json