swap_multiple_ids: For all ids specified, sets their value to the assigned value...

Description Usage Arguments See Also

View source: R/swap_multiple_ids.R

Description

For all ids specified, sets their value to the assigned value within a given variable. Like swap_by_ids, but for multiple ids and one swap value. Useful for imputation.

Usage

1
swap_multiple_ids(df, variable, ids, value, idname = "id")

Arguments

df

dataframe. The data to be transformed.

variable

character. The name of the variable in df where the replacement occurs.

ids

character. A vector of ids to be transformed.

value

character. The value to assign those ids.

idname

character. The name of the column with ids.

See Also

swap_by_ids


peterhurford/surveytools2 documentation built on Feb. 18, 2021, 9:13 p.m.