Appends one or more surveys to an existing collection and returns a new
survey_collection. The original collection is unchanged. Surveys may be
passed with explicit names or as bare symbols (auto-named, like
as_survey_collection()). Duplicate names are repaired by appending
_1, _2, … Existing names are never modified during repair.
Arguments
- .collection
A
survey_collection. Named with a leading dot so it cannot collide with user-supplied names in...(e.g., a survey named"x").- ...
One or more surveys to append. Accepts named arguments (
"wave3" = d3) or bare symbols (d3, auto-named to"d3"). If a new name collides with an existing one (or with another new one), it is repaired by appending_1,_2, … and asurveycore_warning_collection_duplicate_name_repairedwarning is emitted with the mapping.
Examples
d1 <- as_survey(gss_2024, ids = vpsu, weights = wtssps,
strata = vstrat, nest = TRUE)
d2 <- as_survey(gss_2024, ids = vpsu, weights = wtssps,
strata = vstrat, nest = TRUE)
coll <- as_survey_collection(a = d1)
coll2 <- add_survey(coll, b = d2)
names(coll2)
#> [1] "a" "b"
