add_counter: Add Counter

Description Usage Arguments Value

View source: R/add_counter.R

Description

This function identifies all NAs in a column and converts it to a character with a counter, the default value being 'other_counter'. The counter is based on a reference column of choice, the default being the original column. It is not intended to use the original column as the reference but if that's chosen all NA's will show '_1'.

Usage

1
add_counter(df, col, reference_col = col, prefix = "other")

Arguments

df

dataframe

col

character specifying the column selection

reference_col

character showing the reference column. The default is 'col'

prefix

character specifying the prefix that belongs to counter. The default is 'other'

Value

dataframe with 'col' modified.


cadenceinc/yolanda documentation built on Sept. 15, 2020, 5:20 a.m.