RecipeWorkflow R6 class
RecipeWorkflow R6 class
Details
R6 class representing a publishable workflow that captures statistical estimations applied to survey data. Workflows reference the recipes they use and document the estimation calls made.
Methods
- $new(...)
Class constructor.
- $doc()
Generate documentation for the workflow.
- $to_list()
Serialize to a plain list for JSON export.
- $increment_downloads()
Increment the download counter.
- $add_category(category)
Add a category.
- $certify(user, level)
Certify the workflow.
Public fields
idUnique identifier (character).
nameDescriptive name (character).
descriptionWorkflow description (character).
userAuthor/owner (character).
user_infoRecipeUser object or NULL.
survey_typeSurvey type (character).
editionSurvey edition (character).
estimation_typeCharacter vector of estimation types used.
recipe_idsCharacter vector of recipe IDs referenced.
callsList of deparsed call strings.
call_metadataList of lists with type, formula, by, description fields.
categoriesList of RecipeCategory objects.
downloadsInteger download count.
certificationRecipeCertification object.
versionVersion string.
doiDOI or external identifier (character|NULL).
created_atCreation timestamp (character).
weight_specNamed list with weight configuration per periodicity (list|NULL).
Methods
Method new()
Create a RecipeWorkflow object
Usage
RecipeWorkflow$new(
id = NULL,
name,
description = "",
user = "Unknown",
user_info = NULL,
survey_type = "Unknown",
edition = "Unknown",
estimation_type = character(0),
recipe_ids = character(0),
calls = list(),
call_metadata = list(),
categories = list(),
downloads = 0L,
certification = NULL,
version = "1.0.0",
doi = NULL,
created_at = NULL,
weight_spec = NULL
)Arguments
idUnique identifier
nameDescriptive name
descriptionWorkflow description
userAuthor name
user_infoRecipeUser object or NULL
survey_typeSurvey type
editionSurvey edition
estimation_typeCharacter vector of estimation types
recipe_idsCharacter vector of recipe IDs
callsList of deparsed call strings
call_metadataList of call metadata lists
categoriesList of RecipeCategory objects
downloadsInteger download count
certificationRecipeCertification or NULL
versionVersion string
doiDOI or NULL
created_atTimestamp string or NULL (auto-generated)
weight_specNamed list with weight configuration per periodicity
Method add_category()
Add a category to the workflow
Method remove_category()
Remove a category by name
Examples
wf <- RecipeWorkflow$new(
name = "Labor workflow", description = "Unemployment rate",
user = "test", survey_type = "ech", edition = "2023",
estimation_type = "annual", recipe_ids = "r_001",
calls = list("svymean(~desocupado, na.rm = TRUE)")
)