metasurvey 0.0.21
CRAN release: 2026-02-25
New features
-
workflow()now supportsconveypackage functions (svygini,svyatk,svyarpr,svyfgt, etc.) for poverty and inequality estimation with proper standard errors and CVs.
Bug fixes
-
validate_weight()now shows available columns when weight is not found. -
validate_replicate()now lists missing replicate ID columns in the error. -
set_use_copy()andset_lazy_processing()reject non-scalar logical input.
Internal
- Step functions (
step_join,step_remove,step_rename,step_validate,step_filter) now returninvisible(out)per R convention for side-effect functions. - Added
@rdname provenanceto S3 method documentation. - Removed unused
stats::medianandstats::quantileimports. - Use fully qualified
stats::confint()incat_estimation.svyratio. - Added edge case tests: double bake idempotency, filter-then-compute chain,
provenance_diffprint output.
metasurvey 0.0.20
Breaking changes
-
survey_to_data.table()is deprecated in favor ofsurvey_to_datatable()(avoids non-standard dots in function names). The old function still works with a deprecation warning.
New features
-
metasurvey_msg()internal helper wrapsmessage()behindoptions(metasurvey.verbose = FALSE)for silent operation in scripts. - All HTTP requests (ANDA, API client, Shiny) now send a
metasurvey/<version>User-Agent header. -
read_file()now gives an actionable install hint when the required reader package is missing (e.g.,havenfor.dtafiles).
Bug fixes
- Added
call. = FALSEto allstop()andwarning()calls for cleaner error tracebacks without internal call stack noise. - Fixed
&vs&&incompute()andcat_estimation()— single&would evaluate both sides even when the first was FALSE. -
get_metadata()now usescat()instead ofmessage(), making output testable withexpect_output()and suppressible withcapture.output(). - Removed
.onAttach()startup message (package loads silently).
Documentation
- Fixed all broken URLs flagged by CRAN: updated Azure AKS and INE Uruguay redirects, removed dead Railway API and metasurvey-infra links.
- Included
api-databasevignette in build (was excluded via.Rbuildignore, causing broken cross-vignette file URI references). - Reduced vignette tarball from 10.6 MB to 3.7 MB by disabling
visNetworkwidget rendering (eval = FALSE). - Replaced
\dontrun{}examples inget_implantation()andget_follow_up()with runnable examples using test data. - Added runnable examples for
provenance_to_json()andprovenance_diff(). - Added
@family transpilercross-references to all transpiler functions. - Documented default parameter values across all
step_*and tidy API functions. - Added
print.metasurvey_provenance_diffman page. - Removed unused
digestfrom Suggests.
metasurvey 0.0.19
New features
-
step_filter(): new step type for row-level filtering within the pipeline. Multiple conditions are AND-combined. Supports.byfor within-group filtering, lazy evaluation, and RotativePanelSurvey dispatch. -
provenance(): lightweight data lineage tracking. Surveys now record source file, load timestamp, initial row count, and per-step history (type, N before/after, duration). Workflow results carry provenance as an attribute. Includesprovenance_to_json()for audit trails andprovenance_diff()for cross-edition comparison. -
workflow_table(): publication-quality formatted tables fromworkflow()results usinggt. Features confidence intervals, CV quality classification with color coding,compare_byfor side-by-side edition comparison, locale-aware formatting (“en”/“es”), and provenance-based source notes. Falls back toknitr::kable()ifgtis not installed.
Bug fixes
- Fixed stars and comments not persisting to MongoDB: the plumber API star/comment endpoints used
if (!is.null(auth_err))to check authentication, butrequire_auth()always returns non-NULL (user object on success, error list on failure). The endpoints returned the JWT payload immediately without ever reaching the database write. Fixed all 5 affected endpoints (recipe star, recipe comment, workflow star, workflow comment, delete comment) and addedresult$okchecks in Shiny modules so errors are reported instead of silently swallowed.
metasurvey 0.0.18
New features
-
step_validate(): declarative data validation step that checks invariants without mutating data. Supports row-level logical expressions, named checks,.min_n, and.action = "stop"or"warn". - Stars and comments API: users can rate (1-5) and comment on recipes and workflows. New R functions:
api_star_recipe(),api_get_recipe_stars(),api_comment_recipe(),api_get_recipe_comments(),api_delete_comment(),api_get_recipe_dependents(), and workflow equivalents. - Backlinks:
GET /recipes/:id/dependentsreturns recipes that depend on a given recipe viadepends_on_recipes. - Shiny app: star rating widget, comment section, and dependents panel in recipe and workflow detail modals.
Performance
-
optimize_steps()now collapses consecutive independentstep_compute()calls into single calls with dependency analysis, reducing transpiled step counts.
metasurvey 0.0.17
New features
- Indicators API module: new
/indicatorsREST endpoints for publishing estimation results with full traceability (indicator -> workflow -> recipe). Feature-gated viaMETASURVEY_ENABLE_INDICATORSenv var. - Compute worker service: on-demand estimation via
POST /indicators/compute. The worker loads private microdata, applies recipes, and runsworkflow(). Deployed as a separate Docker container, never exposes raw survey data. - Self-hosting vignette: deployment guide with Docker Compose, including hybrid mode (public recipe registry + private worker with microdata).
metasurvey 0.0.16
Dependencies
- Migrated
crayontoclifor terminal output coloring. Allcrayon::bold(),crayon::silver(),crayon::green(), etc. replaced withcli::style_bold(),cli::col_silver(),cli::col_green(), etc. across 8 files. - Migrated
httrtohttr2for HTTP requests. All API client, ANDA catalog, and Shiny helper functions now use the pipe-basedhttr2API (request() |> req_headers() |> req_perform()). - Replaced all
glue::glue_col()calls (which depended on crayon color functions) withglue::glue()+cli::col_*()wrappers. - Removed
bit64andjose(already unused since 0.0.14) from Dockerfile. - Removed
casenfrom Suggests (GitHub-only package, not available on CRAN). - Removed
pakfrom Suggests (no longer used in vignettes).
Bug fixes
- Fixed international-surveys vignette crash on PNADcIBGE example data: set
options(survey.lonely.psu = "adjust")for strata with single PSUs. - Fixed vignette setup chunk that attempted to install packages at build time via
pak; replaced withrequireNamespace()guards. - Updated Shiny Dockerfile dependencies to match new imports (httr2, cli).
metasurvey 0.0.15
New features
- Added
strataparameter toSurvey$new(),survey_empty(),load_survey(), andload_panel_survey()for stratified sampling designs. Passed tosurvey::svydesign(strata = ...). - New vignette: “International Survey Compatibility” (EN + ES) with reproducible examples for ECH, EPH, CASEN, PNADc, CPS, ENIGH, and DHS.
Documentation
- Eliminated
eval=FALSEfrom all vignettes — chunks now use conditional eval or markdown code blocks for non-runnable examples. - Improved man page examples: replaced
\dontrun{}with\donttest{}and runnable local-data examples forcat_design,bake_recipes,recipe,steps_to_recipe,transpile_stata,parse_do_file, and others. - Added stratified cluster design section to complex-designs vignette.
- Rewrote README with live service links (Shiny explorer, REST API), CRAN status badge, and GitHub star call-to-action.
metasurvey 0.0.14
Breaking changes
-
Step$commentsfield renamed toStep$comment. The old name still works as a legacy alias but will be removed in a future version. -
workflow()first parameter renamed fromsurveytosvyfor consistency. Positional usage is unchanged. -
Survey$set_weight()no longer emitsmessage("Setting weight"). -
step_recode().name_stepparameter is deprecated; usecommentinstead.
New features
-
use_copyparameter in all step functions (step_compute,step_recode,step_join,step_remove,step_rename) is deprecated in favour of.copy, following dplyr’s dot-prefix convention for secondary arguments. - Added survey state predicates:
has_steps(),has_recipes(),is_baked(),has_design(). -
step_recode(),step_join(),step_remove(),step_rename()no longer defaultsvytosurvey_empty(); the survey argument is now required. -
extract_time_pattern()now recognises quarter/trimester editions ("2023-T3","2023-Q1"), parsed asQuarterlyperiodicity.
Bug fixes
- Fixed
validate_time_pattern()crash whensvy_editionisNA. - Fixed
shallow_clone()re-runningvalidate_time_pattern()on already-parsed editions, causing cascading NULL → NA → crash. - Fixed
get_metadata()crash when edition is NULL or NA. - Fixed
cat_estimation.svyby()producing wrong output: margins index was integer (not column name), SE column"se"was missed by grep, andcv()data.frame was not handled. Output now shows group labels in thestatcolumn (e.g.svyby: x [sexo=1]). - Mixed estimation types (
svymean+svyby) no longer fail onrbindlistdue to mismatched columns. - Fixed
set_engine()logic bug whereidentical(.engine, show_engines())compared string vs vector, silently failing. - Fixed vague
stop("Error in step")instep_compute()validation — now reports which variables failed. - Removed dead dots-filtering code in
step_remove()andstep_rename().
Dependencies
- Removed unused
bit64import (CRAN compliance). - Replaced
josedependency withjsonlite::base64url_dec()for JWT decoding — one less hard dependency. -
design_activeactive binding now delegates toensure_design(), removing duplicated design-building logic.
Documentation
- All
step_*functions now document lazy evaluation behavior in@details. - Improved
step_remove()andstep_rename()roxygen with full@detailssections matchingstep_compute()depth. -
workflow()@param svynow prominently documents thelist()requirement. - Cleaned up Survey class roxygen: removed duplicate Methods sections.
- Updated vignettes to use
Step$commentinstead ofStep$comments. - Vignettes now use real ECH 2023 sample data instead of simulated data.
- Fixed ECH variable names for 2023 edition (
e31→e30).
metasurvey 0.0.12
Bug fixes
- Fixed critical memory leak when chaining N steps: eliminated
svy_beforeretention chain that prevented GC from freeing N copies of the data.table. - Fixed
bake_stepre-recording step_join/step_remove/step_rename during bake, which caused duplicate steps.
Performance
-
bake_steps()usesshallow_clone()instead ofclone(deep=TRUE), avoiding duplication of the entire step chain on every bake. -
add_step()invalidates design lazily instead of rebuildingsvydesignon every step addition. - Removed wasteful
copy()calls instep_computeandstep_recode.
metasurvey 0.0.11
Documentation
- Fixed examples across 12 R files for strict CRAN compliance: functions requiring an API server, external files, or interactive sessions now use
\dontrun{}instead of\donttest{}. - Fixed
RecipeWorkflowexamples: correctedrecipe_idsparameter name, removed non-existentvariablesparameter. - Fixed
add_weight/add_replicateexamples: removed double-escaped regex patterns, removedload_survey()calls that depend on external files. - Made
set_workflow_backend/get_workflow_backendexamples runnable without\dontrun{}wrapper.
metasurvey 0.0.10
New features
- Docker deployment pipeline with GitHub Actions: builds and pushes images to GHCR, deploys to Railway on push to main.
-
docker-compose.ymlfor local development (API + Shiny stack).
Bug fixes
-
api_url()no longer falls back to a hardcoded production URL; returns NULL when no URL is configured via option or environment variable.
Documentation
- Replaced remaining
\dontrun{}with\donttest{}across all exported examples for CRAN compliance. - Added runnable examples for
RecipeWorkflow,save_workflow,read_workflow,search_workflows,rank_workflows,RecipeBackend. - Added STATA transpiler usage section to README.
- Added Spanish vignettes:
stata-transpiler-es,ech-demographics-recipe-es.
metasurvey 0.0.9
CRAN compliance
- Namespaced all global options:
use_copy→metasurvey.use_copy,lazy_processing→metasurvey.lazy_processing. -
set_use_copy()andset_lazy_processing()return the previous value invisibly, matchingset_engine()behavior. -
set_backend()andset_workflow_backend()return the previous value invisibly. - Replaced all
\dontrun{}examples with runnable or\donttest{}where appropriate (set_engine(),view_graph(),survey_empty(),set_workflow_backend(),get_workflow_backend()). - Fixed
print.RecipeWorkflowexample: removed non-existentrecipe_nameandresultsarguments. - Fixed
extract_time_pattern()roxygen block: was accidentally attached to internalvalidate_monthly(), causing the export to be dropped. - Fixed malformed
@keywordstags: removed comma-separated values inPoolSurveyandRotativePanelSurvey, removed duplicate description block inSurveythat was parsed as keyword entries. - Simplified
.onAttach()to a single version message. - Removed hardcoded production API URL from
.onLoad(). - Deleted orphan Spanish-only vignette
metasurvey-es.Rmd. - Added
.Rbuildignoreentries for deployment artifacts (inst/scripts,inst/seed-data, Dockerfiles,inst/shiny-auth.R). - Deleted empty
inst/extdata/directory. - Fixed
add_weight()regex example. - Fixed
load_survey()example. - Fixed
set_lazy()→set_lazy_processing()in vignettes. - Enabled
eval=TRUEon in-memory vignette chunks (bake,get-steps). -
load_survey_example(): removed deadfile.exists()branch, wrappeddownload.file()intryCatch()for graceful failure. - Added
requireNamespace("htmltools")check inview_graph(). - Removed version constraint from
parallelin Suggests. - R CMD check: 0 errors, 0 warnings, 1 note (new submission).
Translations
- All remaining Spanish return values translated to English:
"Trianual"→"Triennial","Multianual"→"Multi-year". - All Spanish inline comments translated to English.
- Translated roxygen documentation for
recipe(),extract_surveys(),get_implantation(),get_follow_up().
New features
- Added STATA-to-metasurvey transpiler:
transpile_stata(),transpile_stata_module(),parse_do_file(),parse_stata_labels(), andtranspile_coverage(). Converts.dofiles into Recipe JSON, supporting gen/replace chains, recode, egen, foreach loops, mvencode, destring, labels, and more. - Added
labelsfield toRecipeclass for storing variable and value labels from STATA transpilation. - Added Shiny DAG graph loading spinner and disclaimer for recipes with more than 20 steps.
Bug fixes
- Fixed
validate_weight_time_pattern()crash whenweightis NULL (triggered byshallow_clone()on surveys without weights). - Fixed
steps_to_recipe()producing unparseable step strings: longstep_recodecalls were split across multiple lines bydeparse(), breaking JSON round-trip. - Fixed
bake_recipes()not executingstep_renameandstep_remove: recipe step replay now temporarily disables lazy processing so all steps execute immediately. - Fixed Shiny
category_tag()crash when recipe topic is NULL.
Documentation
- Added
@familytags to all exported functions across 16 groups. - Standardized
@keywordstags (removed commas, fixed multi-word entries). - Removed redundant
@titletags inR/set_engine.R. - Updated
cran-comments.mdto reflect 1 NOTE (new submission). - Added
stata-transpilervignette covering all supported STATA patterns. - Added
ech-demographics-recipevignette showing hand-crafted vs transpiled recipe workflows.
metasurvey 0.0.8
Bug fixes
- Fixed 5 occurrences of
stop(message(...))which silently calledstop(NULL)instead of raising a proper error (set_engine(),load_survey(),recipe()). - Fixed
.Rbuildignoredouble-escape bug: patterns had\\\\.instead of\\., causing hidden files and non-standard files to leak into the tarball. - Replaced unsafe
1:nsequences withseq_len()/seq.int()to avoidc(1, 0)when n=0 (7 occurrences across survey.R, workflow.R, steps.R). - Removed duplicate internal
set_data()definition in survey.R. - Replaced raw ANSI escape codes with
crayon::red()/crayon::green()incat_design()for cross-platform compatibility. - Removed unreachable dead code in
load_survey_example(). -
requireNamespace("parallel")now usesquietly = TRUEand checks the return value before using the package. -
requireNamespace("rio")return value is now checked before callingrio::convert().
Security
- SSL certificate verification in ANDA client is now enabled by default. Previously hardcoded
ssl_verifypeer = FALSE; now user-controllable viaoptions(metasurvey.ssl_verify = FALSE). -
api_logout()no longer callsSys.unsetenv("METASURVEY_TOKEN")— only clears the R option, per CRAN policy on environment variables.
CRAN compliance
-
set_engine(),set_use_copy(),set_lazy_processing(), andconfigure_api()now return the previous value invisibly, allowing users to restore global options. - All user-facing messages translated from Spanish to English.
-
evaluate_cv()returns English labels (“Excellent”, “Good”, etc.). -
extract_time_pattern()returns “Invalid format”/“Unknown format”. - DESCRIPTION title and description rewritten to be substantive.
-
inst/CITATIONupdated: removed deprecatedcitHeader(), dynamic year. - Fixed inconsistent maintainer email across DESCRIPTION and package docs.
- R CMD check now passes with 0 errors, 0 warnings, 0 NOTEs.
metasurvey 0.0.7
New features
-
Recipe$to_list()andRecipeWorkflow$to_list()now includemetasurvey_versionfor reproducibility tracking.
Bug fixes
- Fixed
bake_step()crash when executingstep_recode(): removed invalidrecord=FALSEargument passed to internalrecode(). - Fixed
bake_steps_survey()iterating over the original survey’s steps instead of the cloned copy, causing inconsistent state. - Fixed
bake_recipes()environment leakage: recipe step evaluation now uses an isolatednew.env()instead of the callingenvironment(). - Removed redundant
copy()incompute()andrecode()— theshallow_clone()already handles data copying. -
step_join()now usesmerge.data.table()directly andset_data()instead of assigning to$data. - Fixed Shiny admin panel memory leak: replaced dynamic
observe→lapply→observeEventpattern with delegated event handlers. - Removed
invalidateLater(0)from admin panel refresh.
Security
-
store_token()no longer callsSys.setenv()— API tokens are stored in R options only, not leaked to environment variables. -
token_expires_soon()returnsTRUEforNULL, malformed, or missingexpclaims, forcing token refresh instead of using potentially invalid tokens. - API error messages are sanitized to 200 characters maximum.
- Added
validate_api_id()with alphanumeric whitelist for recipe/workflow IDs. - Added password length validation (8–128 characters) in
api_register(). -
api_download_recipe()andapi_download_workflow()now warn on failure instead of silently swallowing errors.
Internal
- Replaced
sapply()withvapply()orlapply()across the codebase for type-safe return values. -
set_engine()usesrequireNamespace()instead ofeval(install.packages(...)). -
read_recipe()now warns when step parsing falls back to raw strings. - Added ORCID identifiers for authors in DESCRIPTION.
- Added ANDA fetch failure notification in Shiny explore module.
metasurvey 0.0.6
Documentation
- All exported functions and R6 classes now have
@returnand@examplesroxygen2 tags, meeting rOpenSci documentation requirements. - Added
@returnto R6 class exports:Recipe,RecipeWorkflow,RecipeCategory,RecipeCertification,RecipeUser,PoolSurvey,RotativePanelSurvey, andSurvey. - Added
@examplestoset_engine(),show_engines(),get_engine(), and all API/backend functions. - Added
@returntoget_metadata(),set_lazy_processing(),set_use_copy(),set_backend(),set_workflow_backend(), andexplore_recipes().
Bug fixes
- Fixed Codecov GitHub Actions workflow: replaced deprecated
covr::codecov()withcovr::package_coverage()+codecov/codecov-action@v5for reliable coverage uploads with token authentication. - Added CI guard to
.Rprofileto skip example-data setup in GitHub Actions, preventing potential download failures during CI builds. - Added missing
archive,haven, andopenxlsxtoSuggestsin DESCRIPTION, fixing R CMD check warnings about undeclared dependencies.
metasurvey 0.0.5
Breaking changes
AST engine removed: The Abstract Syntax Tree evaluation engine (
R/ast.R) has been replaced by directdata.tableexpression evaluation. This simplifies the step pipeline and removes ~760 lines of internal code. Users who relied on internal AST functions (parse_ast,evaluate_ast_node,recode_with_ast,optimize_node) will need to update their code. The public API (step_compute(),step_recode(),bake_steps()) remains unchanged.API client migrated to JWT: The API client (
R/api_client.R) now uses JWT authentication with a self-hosted Plumber backend, replacing the previous Atlas Data API approach.
New features
Lazy design initialization:
Survey$new()no longer buildssvydesignobjects at construction time. Designs are created on-demand when needed (e.g., duringworkflow()orbake_steps()), significantly improving construction performance for large datasets. Thepsuparameter is now optional (defaultNULL).-
Recipe ecosystem: New infrastructure for publishing, discovering, and managing reproducible survey processing recipes:
-
RecipeRegistryR6 class with pluggable backends (JSON file, MongoDB). -
RecipeCategoryfor hierarchical categorization of recipes. -
RecipeCertificationfor quality certification levels (official, reviewed, community). -
RecipeUserfor author/maintainer profiles with institutional affiliations. - Tidy API:
list_recipes(),search_recipes(),filter_recipes(),rank_recipes(). -
Recipe$doc()for auto-generated documentation. -
Recipe$validate(svy)for dependency checking against a survey. -
print.RecipeS3 method for human-readable output. -
save_recipe()/read_recipe()for JSON serialization.
-
-
Workflow system: New estimation workflow infrastructure:
-
RecipeWorkflowR6 class capturingsvymean/svytotal/svyratio/svybycalls with recipe references and reproducibility metadata. -
WorkflowRegistrywith pluggable backends (JSON, MongoDB). - Auto-capture of workflow metadata via
.capture_workflow()when surveys contain recipes. -
workflow_from_list()for reconstructing workflows from JSON/API responses. - Tidy API:
list_workflows(),search_workflows(),filter_workflows(),rank_workflows(),find_workflows_for_recipe(),publish_workflow(). -
save_workflow()/read_workflow()for serialization.
-
REST API (
inst/api/plumber.R): Self-hosted Plumber API with JWT authentication for recipe and workflow publishing. Endpoints for CRUD operations on recipes, workflows, and user management. Includes Docker deployment configuration.-
ANDA catalog integration (
R/anda.R): Functions for accessing INE Uruguay’s ANDA5 catalog metadata:-
anda_catalog_search()for searching the catalog. -
anda_list_editions()for listing available survey editions. -
anda_fetch_ddi()for fetching DDI metadata. -
anda_parse_variables()for extracting variable definitions. -
anda_variable_detail()for detailed variable information.
-
-
Shiny explorer app (
inst/shiny/): Interactive recipe and workflow browser launched viaexplore_recipes():- Recipe gallery with search, filtering by survey type/certification, and detail modals showing pipeline visualization and R code snippets.
- Workflow gallery with estimation timeline and cross-references to recipes.
- User authentication with registration, login, and profile management.
- Token generation for programmatic API access from R scripts.
bake_recipes()handles string steps: Steps stored as strings (from JSON/API) are now parsed to call objects before evaluation, fixing the previous “attempt to apply non-function” error.
Bug fixes
-
is_blank()now handlesNULLand zero-length inputs without error. - Fixed regex in
extract_time_pattern(): type prefix detection now correctly matches only at string start. - Multianual year-range patterns (e.g.,
"2019_2021") are now correctly parsed when separated by underscore. -
validate_time_pattern()gracefully handlesNULL/empty edition strings. - Improved
public_key()error handling with informative messages. -
workflow_from_list()is now exported (was@keywords internal), fixing Shiny app workflow parsing from API responses.
Documentation
- Complete vignette rewrite with
eval=TRUEexamples:-
getting-started: Survey creation, steps, recipes, and workflows. -
recipes: Recipe ecosystem, publishing, and discovery. -
workflows-and-estimation: Estimation workflows and registry. -
complex-designs: Replicate weights, stratified designs. -
panel-analysis: Rotating panel surveys. -
ech-case-study: Full ECH processing example. -
shiny-explorer: Interactive app usage guide. -
api-database: REST API and database architecture.
-
- All vignettes available in Spanish (
*-es.Rmd). - Added
references.bibfor academic citations. - Added
pkgdownsite configuration with rOpenSci template.
metasurvey 0.0.3
- Added
step_join()for merging external reference data into surveys. - Added
step_remove()andstep_rename()for variable management.
metasurvey 0.0.2
- Added
RotativePanelSurveyandPoolSurveyR6 classes for complex designs. - Added
extract_surveys(),get_implantation(),get_follow_up().