get.var: get a variable from a dataframe or vector

Description Usage Arguments Value

View source: R/helper_functions.r View source: R/helper_functions.r

Description

this function was written because a few of the estimator functions need to use weights, and there are several cases to handle: the user could pass in a column name, a vector of weights, or nothing (in which case, the weights should default to 1 for each row in the dataset). for the special case of getting weights, look at the curried fn get.weights (right below)

this function was written because a few of the estimator functions need to use weights, and there are several cases to handle: the user could pass in a column name, a vector of weights, or nothing (in which case, the weights should default to 1 for each row in the dataset). for the special case of getting weights, look at the curried fn get.weights (right below)

Usage

1
2
3
get.var(survey.data, var, default = NA)

get.var(survey.data, var, default = NA)

Arguments

survey.data

the survey dataset

var

either NULL, a column name, or a vector of values

default

the default value to fill in if the variable is not found

survey.data

the survey dataset

var

either NULL, a column name, or a vector of values

default

the default value to fill in if the variable is not found

Value

a vector of values whose length is the same as the number of rows in survey.data; if var is NULL, this has the default values

a vector of values whose length is the same as the number of rows in survey.data; if var is NULL, this has the default values


surveybootstrap documentation built on May 29, 2017, 9:09 a.m.