Skip to content

surveycore v0.5.0

Choose a tag to compare

@JDenn0514 JDenn0514 released this 12 Mar 11:44
· 278 commits to main since this release
95c146d

Breaking changes

  • as_survey_replicate() replaces as_survey_repweights(). The constructor
    name now matches the underlying survey_replicate class.

  • survey_nonprob and as_survey_nonprob() replace survey_calibrated and
    as_survey_calibrated(). "Calibrated" implies a post-processing step on a
    probability sample; nonprob accurately reflects the design type.

  • The positional setter form set_var_label(svy, age, "label") has been
    removed. Use the named form set_var_label(svy, age = "label") instead.

  • extract_var_label(), extract_question_preface(), and extract_var_note()
    now return a named character vector. extract_var_label(svy, age) now
    returns c(age = "Age in years") rather than "Age in years".

  • extract_val_labels() now returns a named list. extract_val_labels(svy, sex)
    now returns list(sex = c(Male = 1L, Female = 2L)) rather than
    c(Male = 1L, Female = 2L).

  • set_variable_labels(), set_value_labels(), set_question_prefaces(), and
    set_variable_notes() have been removed. Use set_var_label(),
    set_val_labels(), set_question_preface(), and set_var_note()
    respectively — all four now accept multiple variables via named ....

New features

  • set_universe() and extract_universe() set and retrieve universe
    (eligibility) annotations for survey variables.

  • set_missing_codes() and extract_missing_codes() set and retrieve missing
    value code vectors for survey variables.

  • extract_metadata() returns all metadata fields (variable_label,
    value_labels, question_preface, note, universe, missing_codes,
    transformations) for one or more variables as a named list.

Enhancements

  • All setter functions now support three call conventions: named ...
    (e.g., set_var_label(svy, age = "Age in years")), a single named
    vector/list in ..., or explicit variable = / content-argument pairs.
    All setters also now work on plain data.frames.

  • All extractor functions accept multiple variables via ..., support three
    output formats ("named_vector", "list", "data_frame"), and accept a
    fill argument to include variables with no metadata in the output.