Bin the values of a selected continuous column into 4 bins (quartiles) and add the bin assignments as a new column

AddColBinnedToQuartiles(inputted.data, col.name.to.bin, name.of.new.col)

Arguments

inputted.data

A dataframe.

col.name.to.bin

Name of a continuous column to use the values for binning.

name.of.new.col

Name of the new column that will be added to the end of the dataframe. A suitable name would be "TARGET.quartile"

Value

A dataframe with bin assignment added as a factor column.

See also