inloop: inloop

Description Usage Arguments Author(s) Examples

Description

Loop that checks to see if a value of a variable in one set is in another set. Returns a vector of the same length as the xset, which in practice can be added to the xset as an additional column.

Usage

1
inloop(xset, yset, xvar, yvar)

Arguments

xset

The first dataframe

yset

The reference dataframe

xvar

Variable holding values to check for in the second dataframe. This should be enclosed in quotation marks.

yvar

Reference dataframe variable that is is checked against. This should be enclosed in quotation marks

Author(s)

J.W. Rozelle

Examples

1
2
3
4
# Unfortunately - I haven't created a dataset yet to demo this. However, this is the loop in practice.
female.df$in_hhmem <- NA
female.df$in_hhmem <- inloop(female.df, hh_mem.df, "clus_FemaleID", "clus_FemaleID")
female.df$in_hhmem <- ifelse(female.df$in_hhmem == 1, 0, 1)

jwilliamrozelle/figured documentation built on June 10, 2021, 5:32 p.m.