unify_margins: Unify margins

Description Usage Arguments Details Value

View source: R/unify_margins.R

Description

This is an internal function called by rake_survey() that makes sure that the raking targets and the survey data match up.

Usage

1
unify_margins(pop_margins, .data)

Arguments

pop_margins

A list of tibbles giving the population margins for raking variables. create_raking_targets() outputs such a list.

.data

The survey data to be raked.

Details

Ensures that the factor levels for each variable in the targets and in the data are in the same order, and that the list of targets is not named.

Value

Cleaned raking targets.


pewresearch/pewmethods documentation built on March 27, 2020, 7:22 p.m.