Logic:
1. start by defining a label that will assign numeric codes to the
strings in a logical order. In a do-file, always follow this by -modify-
in case the label is already defined in some way.
2. use -encode- to generate a new variable, using the predefined
mappings. Strings that are not found in the predefined value label will
be added to the value label, using unassigned numbers. For this reason,
nothing will be assigned the number 3 because we reserved this for a new
category, "root".
3. Nick's nice piece of code that checks for root crops. You could use
the -index- function for a single string, but -inlist- is more general.
-index- has some neat uses; this isn't one of them.
4. Any remaining values are ones that we don't need (strings like "not
applicable" or other crops that don't interest us). These will have been
assigned value labels and numeric codes that can be inspected easily by
typing