process_factor_data function

Treat factors as numeric values

Treat factors as numeric values

Factors are given a numeric value above the highest numeric value in the data. The value of the different levels are sorted by factor and then level.

process_factor_data(dt, factor_cols)

Arguments

  • dt: data.table to plot
  • factor_cols: Columns that are factors or character

Returns

A list of a lookup table with each factor and level and its numeric value, a data.table very similar to the input data, but now with numeric values for factors, and the maximum feature value.