fix_dups creates a data.frame where duplicated columns with a specific suffix are row-wise gone through, and where there is NA in the original column, the suffixed column's data is placed there instead.

fix_dups(data, suffix, remove = T)

Arguments

data

A data.frame or tibble.

suffix

A single string with column suffix to look for.

remove

logical. If column with suffix are to be removed.

Value

a data frame with added/replaced age and timepoint variables.

Examples

if (FALSE) { fix_dups(data, suffix="YY") }