anesrake: Backwards compatibility function call syntax for anesrake

View source: R/anesrake.R

anesrakeR Documentation

Backwards compatibility function call syntax for anesrake

Description

This function exists to provide a backwards compatible function syntax for anesrake and should not be called for any other reason. Rewriting the request as a harvest call is preferable.

Usage

anesrake(inputter, dataframe, caseid = NULL, weightvec = NULL, cap = 5,
  verbose = FALSE, maxit = 1000, type = "pctlim", pctlim = 5,
  nlim = 5, filter = NULL, choosemethod = "total", iterate = NULL,
  convcrit = 0.01, force1 = NULL, center.baseweights = NULL)

Arguments

inputter

Mapped to harvest's target argument

dataframe

Mapped to harvest's data argument

caseid

Ignored

weightvec

Mapped to harvest's start_weights argument

cap

Mapped to harvest's max_weight argument

verbose

Mapped to harvest's verbose argument

maxit

Mapped to harvest's max_iterations argument

type

Mapped to harvest's select_function argument

pctlim

Mapped to harvest's select_params[["pct"]] argument

nlim

Mapped to harvest's select_params[["number"]] argument

filter

Ignored

choosemethod

Mapped to harvest's error_function argument

iterate

Ignored, harvest's functionality is equivalent to iterate = TRUE

convcrit

Mapped to harvest's convergence[["pct"]] argument

force1

Ignored, harvest's functionality is equivalent to force1 = TRUE

center.baseweights

Ignored, harvest's functionality is equivalent to iterate = TRUE

Details

The arguments iterate, force1, and center.baseweights are not supported. iterate and center.baseweights are forced to be TRUE. force1 is ignored and if any target variables do not sum to 1, an error will occur.

Value

A list containing one item, a named vector weightvec which contains the weights generated by harvest. Other elements of anesrake returns are not supported.

Examples

## Not run: 
# Load autumn: this will mask anesrake's anesrake function with autumn's
library(autumn)

# Argument order and names are the same as anesrake; but caseid is no longer
# required and the increased flexibility for data and target arguments from
# `harvest()` are supported.
anesrake(inputter = ns_target, dataframe = respondent_data)

# Most anesrake arguments supported
anesrake(ns_target, respondent_data, type = "nlim", choosemethod = "max")

## End(Not run)

aaronrudkin/autumn documentation built on Feb. 5, 2024, 6:08 p.m.