Builds a level/label lookup table from a factor and serialises it to a JSON string, adding whitespace so the result is readable when stored in a DGF cell. The table is truncated to the first 50 levels.
Value
A single character string containing the pretty-printed JSON representation of the factor's levels and labels.