Package 'metasurvey'

Title: Reproducible Survey Data Processing (Ecosystem Meta-Package)
Description: Meta-package that loads and re-exports the 'metasurvey' ecosystem with a single 'library(metasurvey)', in the style of the 'tidyverse'. It bundles the local processing engine ('metasurvey.core'), the STATA transpiler ('metasurvey.fromstata'), the ANDA client ('metasurvey.anda'), and the recipe/workflow API client ('metasurvey.explorer.backend'), plus high-level orchestration such as 'reproduce_workflow()' that spans them.
Authors: Mauro Loprete [aut, cre] (ORCID: <https://orcid.org/0000-0003-1560-0183>), Natalia da Silva [aut] (ORCID: <https://orcid.org/0000-0002-6031-7451>), Fabricio Machado [aut] (ORCID: <https://orcid.org/0009-0008-2653-9166>)
Maintainer: Mauro Loprete <[email protected]>
License: GPL (>= 3)
Version: 0.3.0
Built: 2026-07-08 17:14:54 UTC
Source: https://github.com/metasurveyr/metasurvey

Help Index


Reproduce a workflow from its published specification

Description

Given a RecipeWorkflow (typically fetched from the registry), downloads the data, resolves the weight configuration, fetches referenced recipes, and returns a Survey object ready for workflow() estimation.

Usage

reproduce_workflow(wf, data_path = NULL, dest_dir = tempdir())

Arguments

wf

RecipeWorkflow object

data_path

Character path to survey microdata. If NULL, attempts to download from ANDA for ECH surveys.

dest_dir

Character directory for downloaded files

Value

Survey object with recipes applied and weight configuration set

Examples

## Not run: 
wf <- api_get_workflow("w_123")
svy <- reproduce_workflow(wf)

## End(Not run)

Resolve a portable weight specification to a usable weight configuration

Description

Converts the portable weight_spec from a RecipeWorkflow back into the format expected by load_survey() and add_weight(). For replicate weights with ANDA sources, automatically downloads the replicate file.

Usage

resolve_weight_spec(weight_spec, dest_dir = tempdir())

Arguments

weight_spec

Named list from RecipeWorkflow$weight_spec

dest_dir

Character directory for downloaded files (default: tempdir())

Value

Named list compatible with add_weight() output

Examples

## Not run: 
wf <- api_get_workflow("w_123")
weight <- resolve_weight_spec(wf$weight_spec)

## End(Not run)